1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_SC_SHEET_GENERAL_FUNCTION_HXX
20 #define INCLUDED_SC_SHEET_GENERAL_FUNCTION_HXX
22 #include <com/sun/star/sheet/GeneralFunction.hpp>
23 #include <com/sun/star/sheet/GeneralFunction2.hpp>
26 * the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2, which causes some type-safety issues.
27 * So abstract them behind the facade of this enum.
29 enum class ScGeneralFunction
31 /** nothing is calculated.
33 NONE
= int(css::sheet::GeneralFunction_NONE
),
35 /** function is determined automatically.
37 <p>If the values are all numerical, SUM is used, otherwise COUNT.</p>
39 AUTO
= int(css::sheet::GeneralFunction_AUTO
),
41 /** sum of all numerical values is calculated.
43 SUM
= int(css::sheet::GeneralFunction_SUM
),
45 /** all values, including non-numerical values, are counted.
47 COUNT
= int(css::sheet::GeneralFunction_COUNT
),
49 /** average of all numerical values is calculated.
51 AVERAGE
= int(css::sheet::GeneralFunction_AVERAGE
),
53 /** maximum value of all numerical values is calculated.
55 MAX
= int(css::sheet::GeneralFunction_MAX
),
57 /** minimum value of all numerical values is calculated.
59 MIN
= int(css::sheet::GeneralFunction_MIN
),
61 /** product of all numerical values is calculated.
63 PRODUCT
= int(css::sheet::GeneralFunction_PRODUCT
),
65 /** numerical values are counted.
67 COUNTNUMS
= int(css::sheet::GeneralFunction_COUNTNUMS
),
69 /** standard deviation is calculated based on a sample.
71 STDEV
= int(css::sheet::GeneralFunction_STDEV
),
73 /** standard deviation is calculated based on the entire population.
75 STDEVP
= int(css::sheet::GeneralFunction_STDEVP
),
77 /** variance is calculated based on a sample.
79 VAR
= int(css::sheet::GeneralFunction_VAR
),
81 /** variance is calculated based on the entire population.
83 VARP
= int(css::sheet::GeneralFunction_VARP
),
86 * median of all numerical values is calculated.
87 * @since LibreOffice 5.3
89 MEDIAN
= css::sheet::GeneralFunction2::MEDIAN