Fix build
[LibreOffice.git] / sc / inc / rangeseq.hxx
blob1657811e2e405970f55bc05ce2512d20c671f753
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 #pragma once
22 #include "types.hxx"
23 #include <com/sun/star/uno/TypeClass.hpp>
25 namespace com::sun::star::uno { class Any; }
27 struct ScInterpreterContext;
28 class ScDocument;
29 class ScMatrix;
30 class ScRange;
32 class ScRangeToSequence
34 public:
35 static bool FillLongArray( css::uno::Any& rAny,
36 ScDocument& rDoc, const ScRange& rRange );
37 static bool FillLongArray( css::uno::Any& rAny,
38 const ScMatrix* pMatrix );
39 static bool FillDoubleArray( css::uno::Any& rAny,
40 ScDocument& rDoc, const ScRange& rRange );
41 static bool FillDoubleArray( css::uno::Any& rAny,
42 const ScMatrix* pMatrix );
43 static bool FillStringArray( css::uno::Any& rAny,
44 ScDocument& rDoc, const ScRange& rRange );
45 static bool FillStringArray( css::uno::Any& rAny,
46 const ScMatrix* pMatrix, ScInterpreterContext& rContext );
47 static bool FillMixedArray( css::uno::Any& rAny,
48 ScDocument& rDoc, const ScRange& rRange,
49 bool bAllowNV = false );
51 /** @param bDataTypes
52 Additionally to the differentiation between string and double allow
53 differentiation between other types such as boolean. Needed for
54 implementation of XFormulaParser. If <FALSE/>, boolean values are
55 treated as ordinary double values 1 (true) and 0 (false).
57 static bool FillMixedArray( css::uno::Any& rAny,
58 const ScMatrix* pMatrix, bool bDataTypes = false );
61 class ScApiTypeConversion
63 public:
65 /** Convert a 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 css::uno::TypeClass & o_eClass,
75 const css::uno::Any & rAny );
79 class ScSequenceToMatrix
81 public:
83 /** Convert a sequence of mixed elements to ScMatrix.
85 Precondition: rAny.getValueType().equals( cppu::UnoType< uno::Sequence< uno::Sequence< uno::Any > > >::get() )
87 @returns a new'd ScMatrix as ScMatrixRef, NULL if rAny couldn't be read
88 as type Sequence<Sequence<Any>>
90 static ScMatrixRef CreateMixedMatrix( const css::uno::Any & rAny );
94 class ScByteSequenceToString
96 public:
97 // rAny must contain either OUString or Sequence<sal_Int8> (thread encoding assumed),
98 // may or may not contain 0-bytes at the end
99 static bool GetString( OUString& rString, const css::uno::Any& rAny );
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */