138d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 338d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 438d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 538d50f7bSAndrew Rist * distributed with this work for additional information 638d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 738d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 838d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 938d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 1138d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 1338d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 1438d50f7bSAndrew Rist * software distributed under the License is distributed on an 1538d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1638d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 1738d50f7bSAndrew Rist * specific language governing permissions and limitations 1838d50f7bSAndrew Rist * under the License. 19cdf0e10cSrcweir * 2038d50f7bSAndrew Rist *************************************************************/ 2138d50f7bSAndrew Rist 2238d50f7bSAndrew 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 { 407*22407013SOliver-Rainer Wittmann SC_DB_MAKE, // if needed create database range with name $STR_DB_NONAME 408*22407013SOliver-Rainer Wittmann SC_DB_IMPORT, // if needed create database range with name $STR_DBNAME_IMPORT[X] 409*22407013SOliver-Rainer Wittmann SC_DB_OLD, // do not create new database range, provide only existing one 410*22407013SOliver-Rainer Wittmann SC_DB_MAKE_AUTOFILTER // if needed create database range with name $SC_DBNAME_UNNAMED[X] 411cdf0e10cSrcweir }; 412cdf0e10cSrcweir 413cdf0e10cSrcweir /// For ScDBFunc::GetDBData() 414cdf0e10cSrcweir enum ScGetDBSelection 415cdf0e10cSrcweir { 416cdf0e10cSrcweir /** Keep selection as is, expand to used data area if no selection. */ 417cdf0e10cSrcweir SC_DBSEL_KEEP, 418cdf0e10cSrcweir 419cdf0e10cSrcweir /** Shrink selection to sheet's data area. */ 420cdf0e10cSrcweir SC_DBSEL_SHRINK_TO_SHEET_DATA, 421cdf0e10cSrcweir 422cdf0e10cSrcweir /** Shrink selection to actually used data area within the selection. */ 423cdf0e10cSrcweir SC_DBSEL_SHRINK_TO_USED_DATA, 424cdf0e10cSrcweir 425cdf0e10cSrcweir /** If only one row or portion thereof is selected, shrink row to used data 426cdf0e10cSrcweir columns and select further rows down until end of data. If an area is 427cdf0e10cSrcweir selected, shrink rows to actually used columns. Else, no selection, 428cdf0e10cSrcweir expand to used data area. */ 429cdf0e10cSrcweir SC_DBSEL_ROW_DOWN, 430cdf0e10cSrcweir 431cdf0e10cSrcweir /** Behave as if the range corresponding to a ScDBData area was selected, 432cdf0e10cSrcweir for API use. */ 433cdf0e10cSrcweir SC_DBSEL_FORCE_MARK 434cdf0e10cSrcweir }; 435cdf0e10cSrcweir 436cdf0e10cSrcweir enum ScLkUpdMode 437cdf0e10cSrcweir { //Verknuepfungen 438cdf0e10cSrcweir LM_ALWAYS, //immer aktualisieren 439cdf0e10cSrcweir LM_NEVER, //niemals 440cdf0e10cSrcweir LM_ON_DEMAND, //auf nachfrage 441cdf0e10cSrcweir LM_UNKNOWN //Shit happens 442cdf0e10cSrcweir }; 443cdf0e10cSrcweir 444cdf0e10cSrcweir 445cdf0e10cSrcweir // ----------------------------------------------------------------------- 446cdf0e10cSrcweir 447cdf0e10cSrcweir //================================================================== 448cdf0e10cSrcweir 449cdf0e10cSrcweir // ----------------------------------------------------------------------- 450cdf0e10cSrcweir 451cdf0e10cSrcweir // enum with values equal to old DBObject enum from sdb 452cdf0e10cSrcweir enum ScDBObject 453cdf0e10cSrcweir { 454cdf0e10cSrcweir ScDbTable, 455cdf0e10cSrcweir ScDbQuery 456cdf0e10cSrcweir }; 457cdf0e10cSrcweir 458cdf0e10cSrcweir struct ScImportParam 459cdf0e10cSrcweir { 460cdf0e10cSrcweir SCCOL nCol1; 461cdf0e10cSrcweir SCROW nRow1; 462cdf0e10cSrcweir SCCOL nCol2; 463cdf0e10cSrcweir SCROW nRow2; 464cdf0e10cSrcweir sal_Bool bImport; 465cdf0e10cSrcweir String aDBName; // Alias der Datenbank 466cdf0e10cSrcweir String aStatement; 467cdf0e10cSrcweir sal_Bool bNative; 468cdf0e10cSrcweir sal_Bool bSql; // Statement oder Name? 469cdf0e10cSrcweir sal_uInt8 nType; // enum DBObject 470cdf0e10cSrcweir 471cdf0e10cSrcweir ScImportParam(); 472cdf0e10cSrcweir ScImportParam( const ScImportParam& r ); 473cdf0e10cSrcweir ~ScImportParam(); 474cdf0e10cSrcweir 475cdf0e10cSrcweir ScImportParam& operator= ( const ScImportParam& r ); 476cdf0e10cSrcweir sal_Bool operator== ( const ScImportParam& r ) const; 477cdf0e10cSrcweir //UNUSED2009-05 void Clear (); 478cdf0e10cSrcweir }; 479cdf0e10cSrcweir 480cdf0e10cSrcweir struct ScStringHashCode 481cdf0e10cSrcweir { operator ()ScStringHashCode482cdf0e10cSrcweir size_t operator()( const String& rStr ) const 483cdf0e10cSrcweir { 484cdf0e10cSrcweir return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() ); 485cdf0e10cSrcweir } 486cdf0e10cSrcweir }; 487cdf0e10cSrcweir 488cdf0e10cSrcweir // ----------------------------------------------------------------------- 489cdf0e10cSrcweir 490cdf0e10cSrcweir class ScDocument; 491cdf0e10cSrcweir class ScDocShell; 492cdf0e10cSrcweir class ScDocShellRef; 493cdf0e10cSrcweir class SvxSearchItem; 494cdf0e10cSrcweir class ScAutoFormat; 495cdf0e10cSrcweir class FuncCollection; 496cdf0e10cSrcweir class ScUnoAddInCollection; 497cdf0e10cSrcweir class ScUserList; 498cdf0e10cSrcweir class SvxBrushItem; 499cdf0e10cSrcweir class ScFunctionList; 500cdf0e10cSrcweir class ScFunctionMgr; 501cdf0e10cSrcweir class SfxItemPool; 502cdf0e10cSrcweir class SdrModel; 503cdf0e10cSrcweir class EditTextObject; 504cdf0e10cSrcweir class SfxObjectShell; 505cdf0e10cSrcweir class SvNumberFormatter; 506cdf0e10cSrcweir class ScUnitConverter; 507cdf0e10cSrcweir class CharClass; 508cdf0e10cSrcweir class LocaleDataWrapper; 509cdf0e10cSrcweir class SvtSysLocale; 510cdf0e10cSrcweir class CalendarWrapper; 511cdf0e10cSrcweir class CollatorWrapper; 512cdf0e10cSrcweir class IntlWrapper; 513cdf0e10cSrcweir class OutputDevice; 514cdf0e10cSrcweir 515cdf0e10cSrcweir namespace com { namespace sun { namespace star { 516cdf0e10cSrcweir namespace lang { 517cdf0e10cSrcweir struct Locale; 518cdf0e10cSrcweir } 519cdf0e10cSrcweir namespace i18n { 520cdf0e10cSrcweir class XOrdinalSuffix; 521cdf0e10cSrcweir } 522cdf0e10cSrcweir }}} 523cdf0e10cSrcweir namespace utl { 524cdf0e10cSrcweir class TransliterationWrapper; 525cdf0e10cSrcweir } 526cdf0e10cSrcweir 527cdf0e10cSrcweir #ifndef _SCALC_EXE 528cdf0e10cSrcweir class ScGlobal 529cdf0e10cSrcweir { 530cdf0e10cSrcweir static SvxSearchItem* pSearchItem; 531cdf0e10cSrcweir static ScAutoFormat* pAutoFormat; 532cdf0e10cSrcweir static FuncCollection* pFuncCollection; 533cdf0e10cSrcweir static ScUnoAddInCollection* pAddInCollection; 534cdf0e10cSrcweir static ScUserList* pUserList; 535cdf0e10cSrcweir static String** ppRscString; 536cdf0e10cSrcweir static String* pStrScDoc; 537cdf0e10cSrcweir static String* pEmptyString; 538cdf0e10cSrcweir static String* pStrClipDocName; 539cdf0e10cSrcweir static SvxBrushItem* pEmptyBrushItem; 540cdf0e10cSrcweir static SvxBrushItem* pButtonBrushItem; 541cdf0e10cSrcweir static SvxBrushItem* pEmbeddedBrushItem; 542cdf0e10cSrcweir static SvxBrushItem* pProtectedBrushItem; 543cdf0e10cSrcweir 544cdf0e10cSrcweir static ImageList* pOutlineBitmaps; 545cdf0e10cSrcweir static ImageList* pOutlineBitmapsHC; 546cdf0e10cSrcweir 547cdf0e10cSrcweir // static Bitmap* pAnchorBitmap; 548cdf0e10cSrcweir // static Bitmap* pGrayAnchorBitmap; 549cdf0e10cSrcweir 550cdf0e10cSrcweir static ScFunctionList* pStarCalcFunctionList; 551cdf0e10cSrcweir static ScFunctionMgr* pStarCalcFunctionMgr; 552cdf0e10cSrcweir 553cdf0e10cSrcweir static ScUnitConverter* pUnitConverter; 554cdf0e10cSrcweir 555cdf0e10cSrcweir static SvNumberFormatter* pEnglishFormatter; // for UNO / XML export 556cdf0e10cSrcweir 557cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XOrdinalSuffix> xOrdinalSuffix; 558cdf0e10cSrcweir static CalendarWrapper* pCalendar; 559cdf0e10cSrcweir static CollatorWrapper* pCaseCollator; 560cdf0e10cSrcweir static CollatorWrapper* pCollator; 561cdf0e10cSrcweir static ::utl::TransliterationWrapper* pTransliteration; 562cdf0e10cSrcweir static ::utl::TransliterationWrapper* pCaseTransliteration; 563cdf0e10cSrcweir static IntlWrapper* pScIntlWrapper; 564cdf0e10cSrcweir static ::com::sun::star::lang::Locale* pLocale; 565cdf0e10cSrcweir 566cdf0e10cSrcweir public: 567cdf0e10cSrcweir static SvtSysLocale* pSysLocale; 568cdf0e10cSrcweir // for faster access a pointer to the single instance provided by SvtSysLocale 569cdf0e10cSrcweir SC_DLLPUBLIC static const CharClass* pCharClass; 570cdf0e10cSrcweir // for faster access a pointer to the single instance provided by SvtSysLocale 571cdf0e10cSrcweir SC_DLLPUBLIC static const LocaleDataWrapper* pLocaleData; 572cdf0e10cSrcweir SC_DLLPUBLIC static const LocaleDataWrapper* GetpLocaleData(); 573cdf0e10cSrcweir 574cdf0e10cSrcweir static CalendarWrapper* GetCalendar(); 575cdf0e10cSrcweir SC_DLLPUBLIC static CollatorWrapper* GetCollator(); 576cdf0e10cSrcweir static CollatorWrapper* GetCaseCollator(); 577cdf0e10cSrcweir static IntlWrapper* GetScIntlWrapper(); 578cdf0e10cSrcweir static ::com::sun::star::lang::Locale* GetLocale(); 579cdf0e10cSrcweir 580cdf0e10cSrcweir SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); //CHINA001 581cdf0e10cSrcweir static ::utl::TransliterationWrapper* GetCaseTransliteration(); 582cdf0e10cSrcweir 583cdf0e10cSrcweir SC_DLLPUBLIC static LanguageType eLnge; 584cdf0e10cSrcweir static sal_Unicode cListDelimiter; 585cdf0e10cSrcweir 586cdf0e10cSrcweir static const String& GetClipDocName(); 587cdf0e10cSrcweir static void SetClipDocName( const String& rNew ); 588cdf0e10cSrcweir SC_DLLPUBLIC static const SvxSearchItem& GetSearchItem(); 589cdf0e10cSrcweir SC_DLLPUBLIC static void SetSearchItem( const SvxSearchItem& rNew ); 590cdf0e10cSrcweir SC_DLLPUBLIC static ScAutoFormat* GetAutoFormat(); 591cdf0e10cSrcweir static void ClearAutoFormat(); //BugId 54209 592cdf0e10cSrcweir static FuncCollection* GetFuncCollection(); 593cdf0e10cSrcweir SC_DLLPUBLIC static ScUnoAddInCollection* GetAddInCollection(); 594cdf0e10cSrcweir SC_DLLPUBLIC static ScUserList* GetUserList(); 595cdf0e10cSrcweir static void SetUserList( const ScUserList* pNewList ); 596cdf0e10cSrcweir SC_DLLPUBLIC static const String& GetRscString( sal_uInt16 nIndex ); 597cdf0e10cSrcweir static void OpenURL( const String& rURL, const String& rTarget ); 598cdf0e10cSrcweir SC_DLLPUBLIC static String GetAbsDocName( const String& rFileName, 599cdf0e10cSrcweir SfxObjectShell* pShell ); 600cdf0e10cSrcweir SC_DLLPUBLIC static String GetDocTabName( const String& rFileName, 601cdf0e10cSrcweir const String& rTabName ); 602cdf0e10cSrcweir SC_DLLPUBLIC static sal_uLong GetStandardFormat( SvNumberFormatter&, 603cdf0e10cSrcweir sal_uLong nFormat, short nType ); 604cdf0e10cSrcweir SC_DLLPUBLIC static sal_uLong GetStandardFormat( double, SvNumberFormatter&, 605cdf0e10cSrcweir sal_uLong nFormat, short nType ); 606cdf0e10cSrcweir 607cdf0e10cSrcweir SC_DLLPUBLIC static double nScreenPPTX; 608cdf0e10cSrcweir SC_DLLPUBLIC static double nScreenPPTY; 609cdf0e10cSrcweir 610cdf0e10cSrcweir static ScDocShellRef* pDrawClipDocShellRef; 611cdf0e10cSrcweir 612cdf0e10cSrcweir static sal_uInt16 nDefFontHeight; 613cdf0e10cSrcweir static sal_uInt16 nStdRowHeight; 614cdf0e10cSrcweir 615cdf0e10cSrcweir SC_DLLPUBLIC static long nLastRowHeightExtra; 616cdf0e10cSrcweir static long nLastColWidthExtra; 617cdf0e10cSrcweir 618cdf0e10cSrcweir static void Init(); // am Anfang 619cdf0e10cSrcweir static void InitAddIns(); 620cdf0e10cSrcweir static void Clear(); // bei Programmende 621cdf0e10cSrcweir 622cdf0e10cSrcweir static void UpdatePPT(OutputDevice* pDev); 623cdf0e10cSrcweir 624cdf0e10cSrcweir static void InitTextHeight(SfxItemPool* pPool); GetEmptyBrushItem()625cdf0e10cSrcweir static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; } 626cdf0e10cSrcweir static SvxBrushItem* GetButtonBrushItem(); GetEmbeddedBrushItem()627cdf0e10cSrcweir static SvxBrushItem* GetEmbeddedBrushItem() { return pEmbeddedBrushItem; } GetProtectedBrushItem()628cdf0e10cSrcweir static SvxBrushItem* GetProtectedBrushItem() { return pProtectedBrushItem; } 629cdf0e10cSrcweir SC_DLLPUBLIC static const String& GetEmptyString(); 630cdf0e10cSrcweir static const String& GetScDocString(); 631cdf0e10cSrcweir 632cdf0e10cSrcweir /** Returns the specified image list with outline symbols. 633cdf0e10cSrcweir @param bHC false = standard symbols; true = high contrast symbols. */ 634cdf0e10cSrcweir static ImageList* GetOutlineSymbols( bool bHC ); 635cdf0e10cSrcweir 636cdf0e10cSrcweir // static const Bitmap& GetAnchorBitmap(); 637cdf0e10cSrcweir // static const Bitmap& GetGrayAnchorBitmap(); 638cdf0e10cSrcweir 639cdf0e10cSrcweir static bool HasStarCalcFunctionList(); 640cdf0e10cSrcweir static ScFunctionList* GetStarCalcFunctionList(); 641cdf0e10cSrcweir static ScFunctionMgr* GetStarCalcFunctionMgr(); 642cdf0e10cSrcweir static void ResetFunctionList(); 643cdf0e10cSrcweir 644cdf0e10cSrcweir static String GetErrorString(sal_uInt16 nErrNumber); 645cdf0e10cSrcweir static String GetLongErrorString(sal_uInt16 nErrNumber); 646cdf0e10cSrcweir static sal_Bool EETextObjEqual( const EditTextObject* pObj1, 647cdf0e10cSrcweir const EditTextObject* pObj2 ); 648cdf0e10cSrcweir static sal_Bool CheckWidthInvalidate( sal_Bool& bNumFormatChanged, 649cdf0e10cSrcweir const SfxItemSet& rNewAttrs, 650cdf0e10cSrcweir const SfxItemSet& rOldAttrs ); 651cdf0e10cSrcweir static sal_Bool HasAttrChanged( const SfxItemSet& rNewAttrs, 652cdf0e10cSrcweir const SfxItemSet& rOldAttrs, 653cdf0e10cSrcweir const sal_uInt16 nWhich ); 654cdf0e10cSrcweir 655cdf0e10cSrcweir static ScUnitConverter* GetUnitConverter(); 656cdf0e10cSrcweir 657cdf0e10cSrcweir /// strchr() functionality on unicode, as long as we need it for ScToken etc. 658cdf0e10cSrcweir static const sal_Unicode* UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c ); 659cdf0e10cSrcweir ToUpperAlpha(sal_Unicode c)660cdf0e10cSrcweir static inline sal_Unicode ToUpperAlpha( sal_Unicode c ) 661cdf0e10cSrcweir { return ( c >= 'a' && c <= 'z' ) ? ( c-'a'+'A' ) : c; } 662cdf0e10cSrcweir 663cdf0e10cSrcweir /** Adds the string rToken to rTokenList, using a list separator character. 664cdf0e10cSrcweir @param rTokenList The string list where the token will be appended to. 665cdf0e10cSrcweir @param rToken The token string to append to the token list. 666cdf0e10cSrcweir @param cSep The character to separate the tokens. 667cdf0e10cSrcweir @param nSepCount Specifies how often cSep is inserted between two tokens. 668cdf0e10cSrcweir @param bForceSep true = Always insert separator; false = Only, if not at begin or end. */ 669cdf0e10cSrcweir SC_DLLPUBLIC static void AddToken( 670cdf0e10cSrcweir String& rTokenList, const String& rToken, 671cdf0e10cSrcweir sal_Unicode cSep, xub_StrLen nSepCount = 1, 672cdf0e10cSrcweir bool bForceSep = false ); 673cdf0e10cSrcweir 674cdf0e10cSrcweir /** Returns true, if the first and last character of the string is cQuote. */ 675cdf0e10cSrcweir SC_DLLPUBLIC static bool IsQuoted( const String& rString, sal_Unicode cQuote = '\'' ); 676cdf0e10cSrcweir 677cdf0e10cSrcweir /** Inserts the character cQuote at beginning and end of rString. 678cdf0e10cSrcweir @param bEscapeEmbedded If <TRUE/>, embedded quote characters are 679cdf0e10cSrcweir escaped by doubling them. 680cdf0e10cSrcweir */ 681cdf0e10cSrcweir SC_DLLPUBLIC static void AddQuotes( String& rString, sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true ); 682cdf0e10cSrcweir 683cdf0e10cSrcweir /** Erases the character cQuote from rString, if it exists at beginning AND end. 684cdf0e10cSrcweir @param bUnescapeEmbedded If <TRUE/>, embedded doubled quote characters 685cdf0e10cSrcweir are unescaped by replacing them with a 686cdf0e10cSrcweir single instance. 687cdf0e10cSrcweir */ 688cdf0e10cSrcweir SC_DLLPUBLIC static void EraseQuotes( String& rString, sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true ); 689cdf0e10cSrcweir 690cdf0e10cSrcweir /** Finds an unquoted instance of cChar in rString, starting at 691cdf0e10cSrcweir offset nStart. Unquoted instances may occur when concatenating two 692cdf0e10cSrcweir quoted strings with a separator, for example, 's1':'s2'. Embedded 693cdf0e10cSrcweir quotes have to be escaped by being doubled. Caller must ensure that 694cdf0e10cSrcweir nStart points into an unquoted range or the opening quote. Specialty: 695cdf0e10cSrcweir if cChar==cQuote the first cQuote character from nStart on is found. 696cdf0e10cSrcweir @returns offset if found, else STRING_NOTFOUND 697cdf0e10cSrcweir */ 698cdf0e10cSrcweir SC_DLLPUBLIC static xub_StrLen FindUnquoted( const String& rString, sal_Unicode cChar, xub_StrLen nStart = 0, sal_Unicode cQuote = '\'' ); 699cdf0e10cSrcweir 700cdf0e10cSrcweir /** Finds an unquoted instance of cChar in null-terminated pString. Same 701cdf0e10cSrcweir semantics as FindUnquoted( const String&, ...) 702cdf0e10cSrcweir @returns: pointer to cChar if found, else NULL 703cdf0e10cSrcweir */ 704cdf0e10cSrcweir SC_DLLPUBLIC static const sal_Unicode* FindUnquoted( const sal_Unicode* pString, sal_Unicode cChar, sal_Unicode cQuote = '\'' ); 705cdf0e10cSrcweir 706cdf0e10cSrcweir 707cdf0e10cSrcweir static CharSet GetCharsetValue( const String& rCharSet ); 708cdf0e10cSrcweir static String GetCharsetString( CharSet eVal ); 709cdf0e10cSrcweir 710cdf0e10cSrcweir /// a "ReadOnly" formatter for UNO/XML export 711cdf0e10cSrcweir static SvNumberFormatter* GetEnglishFormatter(); 712cdf0e10cSrcweir 713cdf0e10cSrcweir static sal_Bool IsSystemRTL(); // depending on system language 714cdf0e10cSrcweir static LanguageType GetEditDefaultLanguage(); // for EditEngine::SetDefaultLanguage 715cdf0e10cSrcweir SC_DLLPUBLIC static sal_uInt8 GetDefaultScriptType(); // for all WEAK characters 716cdf0e10cSrcweir /** Map ATTR_((CJK|CTL)_)?FONT_... to proper WhichIDs. 717cdf0e10cSrcweir If more than one SCRIPTTYPE_... values are or'ed together, prefers 718cdf0e10cSrcweir first COMPLEX, then ASIAN */ 719cdf0e10cSrcweir SC_DLLPUBLIC static sal_uInt16 GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich ); 720cdf0e10cSrcweir 721cdf0e10cSrcweir /** Adds a language item to the item set, if the number format item contains 722cdf0e10cSrcweir a language that differs from its parent's language. */ 723cdf0e10cSrcweir SC_DLLPUBLIC static void AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter ); 724cdf0e10cSrcweir 725cdf0e10cSrcweir /** Obtain the ordinal suffix for a number according to the system locale */ 726cdf0e10cSrcweir static String GetOrdinalSuffix( sal_Int32 nNumber); 727cdf0e10cSrcweir }; 728cdf0e10cSrcweir #endif 729cdf0e10cSrcweir 730cdf0e10cSrcweir //================================================================== 731cdf0e10cSrcweir // evtl. in dbdata.hxx auslagern (?): 732cdf0e10cSrcweir 733cdf0e10cSrcweir enum ScQueryOp 734cdf0e10cSrcweir { 735cdf0e10cSrcweir SC_EQUAL, 736cdf0e10cSrcweir SC_LESS, 737cdf0e10cSrcweir SC_GREATER, 738cdf0e10cSrcweir SC_LESS_EQUAL, 739cdf0e10cSrcweir SC_GREATER_EQUAL, 740cdf0e10cSrcweir SC_NOT_EQUAL, 741cdf0e10cSrcweir SC_TOPVAL, 742cdf0e10cSrcweir SC_BOTVAL, 743cdf0e10cSrcweir SC_TOPPERC, 744cdf0e10cSrcweir SC_BOTPERC, 745cdf0e10cSrcweir SC_CONTAINS, 746cdf0e10cSrcweir SC_DOES_NOT_CONTAIN, 747cdf0e10cSrcweir SC_BEGINS_WITH, 748cdf0e10cSrcweir SC_DOES_NOT_BEGIN_WITH, 749cdf0e10cSrcweir SC_ENDS_WITH, 750cdf0e10cSrcweir SC_DOES_NOT_END_WITH 751cdf0e10cSrcweir }; 752cdf0e10cSrcweir 753cdf0e10cSrcweir // ----------------------------------------------------------------------- 754cdf0e10cSrcweir 755cdf0e10cSrcweir enum ScQueryConnect 756cdf0e10cSrcweir { 757cdf0e10cSrcweir SC_AND, 758cdf0e10cSrcweir SC_OR 759cdf0e10cSrcweir }; 760cdf0e10cSrcweir 761cdf0e10cSrcweir // ----------------------------------------------------------------------- 762cdf0e10cSrcweir 763cdf0e10cSrcweir enum ScSubTotalFunc 764cdf0e10cSrcweir { 765cdf0e10cSrcweir SUBTOTAL_FUNC_NONE = 0, 766cdf0e10cSrcweir SUBTOTAL_FUNC_AVE = 1, 767cdf0e10cSrcweir SUBTOTAL_FUNC_CNT = 2, 768cdf0e10cSrcweir SUBTOTAL_FUNC_CNT2 = 3, 769cdf0e10cSrcweir SUBTOTAL_FUNC_MAX = 4, 770cdf0e10cSrcweir SUBTOTAL_FUNC_MIN = 5, 771cdf0e10cSrcweir SUBTOTAL_FUNC_PROD = 6, 772cdf0e10cSrcweir SUBTOTAL_FUNC_STD = 7, 773cdf0e10cSrcweir SUBTOTAL_FUNC_STDP = 8, 774cdf0e10cSrcweir SUBTOTAL_FUNC_SUM = 9, 775cdf0e10cSrcweir SUBTOTAL_FUNC_VAR = 10, 776cdf0e10cSrcweir SUBTOTAL_FUNC_VARP = 11 777cdf0e10cSrcweir }; 778cdf0e10cSrcweir 779cdf0e10cSrcweir 780cdf0e10cSrcweir // ----------------------------------------------------------------------- 781cdf0e10cSrcweir 782cdf0e10cSrcweir /* 783cdf0e10cSrcweir * Dialog liefert die ausgezeichneten Feldwerte "leer"/"nicht leer" 784cdf0e10cSrcweir * als Konstanten SC_EMPTYFIELDS bzw. SC_NONEMPTYFIELDS in nVal in 785cdf0e10cSrcweir * Verbindung mit dem Schalter bQueryByString auf FALSE. 786cdf0e10cSrcweir */ 787cdf0e10cSrcweir 788cdf0e10cSrcweir #define SC_EMPTYFIELDS ((double)0x0042) 789cdf0e10cSrcweir #define SC_NONEMPTYFIELDS ((double)0x0043) 790cdf0e10cSrcweir 791cdf0e10cSrcweir namespace utl 792cdf0e10cSrcweir { 793cdf0e10cSrcweir class SearchParam; 794cdf0e10cSrcweir class TextSearch; 795cdf0e10cSrcweir } 796cdf0e10cSrcweir 797cdf0e10cSrcweir struct ScQueryEntry 798cdf0e10cSrcweir { 799cdf0e10cSrcweir sal_Bool bDoQuery; 800cdf0e10cSrcweir sal_Bool bQueryByString; 801cdf0e10cSrcweir bool bQueryByDate; 802cdf0e10cSrcweir SCCOLROW nField; 803cdf0e10cSrcweir ScQueryOp eOp; 804cdf0e10cSrcweir ScQueryConnect eConnect; 805cdf0e10cSrcweir String* pStr; 806cdf0e10cSrcweir double nVal; 807cdf0e10cSrcweir utl::SearchParam* pSearchParam; // falls RegExp, nicht gespeichert 808cdf0e10cSrcweir utl::TextSearch* pSearchText; // falls RegExp, nicht gespeichert 809cdf0e10cSrcweir 810cdf0e10cSrcweir ScQueryEntry(); 811cdf0e10cSrcweir ScQueryEntry(const ScQueryEntry& r); 812cdf0e10cSrcweir ~ScQueryEntry(); 813cdf0e10cSrcweir 814cdf0e10cSrcweir // legt ggbf. pSearchParam und pSearchText an, immer RegExp! 815cdf0e10cSrcweir utl::TextSearch* GetSearchTextPtr( sal_Bool bCaseSens ); 816cdf0e10cSrcweir 817cdf0e10cSrcweir void Clear(); 818cdf0e10cSrcweir ScQueryEntry& operator=( const ScQueryEntry& r ); 819cdf0e10cSrcweir sal_Bool operator==( const ScQueryEntry& r ) const; 820cdf0e10cSrcweir }; 821cdf0e10cSrcweir 822cdf0e10cSrcweir // ----------------------------------------------------------------------- 823cdf0e10cSrcweir 824cdf0e10cSrcweir struct SC_DLLPUBLIC ScSubTotalParam 825cdf0e10cSrcweir { 826cdf0e10cSrcweir SCCOL nCol1; // Selektierter Bereich 827cdf0e10cSrcweir SCROW nRow1; 828cdf0e10cSrcweir SCCOL nCol2; 829cdf0e10cSrcweir SCROW nRow2; 830cdf0e10cSrcweir sal_Bool bRemoveOnly; 831cdf0e10cSrcweir sal_Bool bReplace; // vorhandene Ergebnisse ersetzen 832cdf0e10cSrcweir sal_Bool bPagebreak; // Seitenumbruch bei Gruppenwechsel 833cdf0e10cSrcweir sal_Bool bCaseSens; // Gross-/Kleinschreibung 834cdf0e10cSrcweir sal_Bool bDoSort; // vorher sortieren 835cdf0e10cSrcweir sal_Bool bAscending; // aufsteigend sortieren 836cdf0e10cSrcweir sal_Bool bUserDef; // Benutzer-def. Sort.Reihenfolge 837cdf0e10cSrcweir sal_uInt16 nUserIndex; // Index auf Liste 838cdf0e10cSrcweir sal_Bool bIncludePattern; // Formate mit sortieren 839cdf0e10cSrcweir sal_Bool bGroupActive[MAXSUBTOTAL]; // aktive Gruppen 840cdf0e10cSrcweir SCCOL nField[MAXSUBTOTAL]; // zugehoeriges Feld 841cdf0e10cSrcweir SCCOL nSubTotals[MAXSUBTOTAL]; // Anzahl der SubTotals 842cdf0e10cSrcweir SCCOL* pSubTotals[MAXSUBTOTAL]; // Array der zu berechnenden Spalten 843cdf0e10cSrcweir ScSubTotalFunc* pFunctions[MAXSUBTOTAL]; // Array der zugehoerige Funktionen 844cdf0e10cSrcweir 845cdf0e10cSrcweir ScSubTotalParam(); 846cdf0e10cSrcweir ScSubTotalParam( const ScSubTotalParam& r ); 847cdf0e10cSrcweir 848cdf0e10cSrcweir ScSubTotalParam& operator= ( const ScSubTotalParam& r ); 849cdf0e10cSrcweir sal_Bool operator== ( const ScSubTotalParam& r ) const; 850cdf0e10cSrcweir void Clear (); 851cdf0e10cSrcweir void SetSubTotals ( sal_uInt16 nGroup, 852cdf0e10cSrcweir const SCCOL* ptrSubTotals, 853cdf0e10cSrcweir const ScSubTotalFunc* ptrFuncions, 854cdf0e10cSrcweir sal_uInt16 nCount ); 855cdf0e10cSrcweir }; 856cdf0e10cSrcweir 857cdf0e10cSrcweir // ----------------------------------------------------------------------- 858cdf0e10cSrcweir class ScArea; 859cdf0e10cSrcweir 860cdf0e10cSrcweir struct ScConsolidateParam 861cdf0e10cSrcweir { 862cdf0e10cSrcweir SCCOL nCol; // Cursor Position / 863cdf0e10cSrcweir SCROW nRow; // bzw. Anfang des Zielbereiches 864cdf0e10cSrcweir SCTAB nTab; 865cdf0e10cSrcweir ScSubTotalFunc eFunction; // Berechnungsvorschrift 866cdf0e10cSrcweir sal_uInt16 nDataAreaCount; // Anzahl der Datenbereiche 867cdf0e10cSrcweir ScArea** ppDataAreas; // Zeiger-Array auf Datenbereiche 868cdf0e10cSrcweir sal_Bool bByCol; // nach Spalten 869cdf0e10cSrcweir sal_Bool bByRow; // nach Zeilen 870cdf0e10cSrcweir sal_Bool bReferenceData; // Quelldaten referenzieren 871cdf0e10cSrcweir 872cdf0e10cSrcweir ScConsolidateParam(); 873cdf0e10cSrcweir ScConsolidateParam( const ScConsolidateParam& r ); 874cdf0e10cSrcweir ~ScConsolidateParam(); 875cdf0e10cSrcweir 876cdf0e10cSrcweir ScConsolidateParam& operator= ( const ScConsolidateParam& r ); 877cdf0e10cSrcweir sal_Bool operator== ( const ScConsolidateParam& r ) const; 878cdf0e10cSrcweir void Clear (); // = ClearDataAreas()+Members 879cdf0e10cSrcweir void ClearDataAreas (); 880cdf0e10cSrcweir void SetAreas ( ScArea* const* ppAreas, sal_uInt16 nCount ); 881cdf0e10cSrcweir }; 882cdf0e10cSrcweir 883cdf0e10cSrcweir // ----------------------------------------------------------------------- 884cdf0e10cSrcweir extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001 885cdf0e10cSrcweir extern const LocaleDataWrapper* GetScGlobalpLocaleData(); 886cdf0e10cSrcweir 887cdf0e10cSrcweir #endif 888