Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / rangeseq.hxx
blob64e9f6cfb995239aff106c1f845f1d7fcc560a79
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_RANGESEQ_HXX
21 #define SC_RANGESEQ_HXX
23 #include <tools/solar.h>
24 #include <com/sun/star/uno/Any.h>
25 #include "types.hxx"
27 class SvNumberFormatter;
28 class ScDocument;
29 class ScRange;
31 class ScRangeToSequence
33 public:
34 static sal_Bool FillLongArray( com::sun::star::uno::Any& rAny,
35 ScDocument* pDoc, const ScRange& rRange );
36 static sal_Bool FillLongArray( com::sun::star::uno::Any& rAny,
37 const ScMatrix* pMatrix );
38 static sal_Bool FillDoubleArray( com::sun::star::uno::Any& rAny,
39 ScDocument* pDoc, const ScRange& rRange );
40 static sal_Bool FillDoubleArray( com::sun::star::uno::Any& rAny,
41 const ScMatrix* pMatrix );
42 static sal_Bool FillStringArray( com::sun::star::uno::Any& rAny,
43 ScDocument* pDoc, const ScRange& rRange );
44 static sal_Bool FillStringArray( com::sun::star::uno::Any& rAny,
45 const ScMatrix* pMatrix, SvNumberFormatter* pFormatter );
46 static sal_Bool FillMixedArray( com::sun::star::uno::Any& rAny,
47 ScDocument* pDoc, const ScRange& rRange,
48 sal_Bool bAllowNV = false );
50 /** @param bDataTypes
51 Additionally to the differentiation between string and double allow
52 differentiation between other types such as as boolean. Needed for
53 implementation of XFormulaParser. If <FALSE/>, boolean values are
54 treated as ordinary double values 1 (true) and 0 (false).
56 static sal_Bool FillMixedArray( com::sun::star::uno::Any& rAny,
57 const ScMatrix* pMatrix, bool bDataTypes = false );
61 class ScApiTypeConversion
63 public:
65 /** Convert an uno::Any to double if possible, including integer types.
66 @param o_fVal
67 Out: the double value on successful conversion.
68 @param o_eClass
69 Out: the uno::TypeClass of rAny.
70 @returns <TRUE/> if successfully converted.
72 static bool ConvertAnyToDouble(
73 double & o_fVal,
74 com::sun::star::uno::TypeClass & o_eClass,
75 const com::sun::star::uno::Any & rAny );
80 class ScSequenceToMatrix
82 public:
84 /** Convert a sequence of mixed elements to ScMatrix.
86 Precondition: rAny.getValueType().equals( getCppuType( (uno::Sequence< uno::Sequence< uno::Any > > *)0))
88 @returns a new'd ScMatrix as ScMatrixRef, NULL if rAny couldn't be read
89 as type Sequence<Sequence<Any>>
91 static ScMatrixRef CreateMixedMatrix( const com::sun::star::uno::Any & rAny );
96 class ScByteSequenceToString
98 public:
99 // rAny must contain Sequence<sal_Int8>,
100 // may or may not contain 0-bytes at the end
101 static sal_Bool GetString( OUString& rString, const com::sun::star::uno::Any& rAny,
102 sal_uInt16 nEncoding );
105 #endif
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */