summaryrefslogtreecommitdiff
path: root/sc/inc/generalfunction.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-14 11:56:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-15 10:29:31 +0000
commitc9da7f6bfe25d217fe3fdd09b82b95e9491cd8e3 (patch)
treec7150e564d45a9e1eab10d19904610e807a867eb /sc/inc/generalfunction.hxx
parent6c3968e234e8ee49103921930de87801bcc048bc (diff)
introduce ScGeneralFunction scoped enum
to abstract over css::sheet::GeneralFunction and css::sheet::GeneralFunction2 Change-Id: I4d4df35a249bf66e12240a3b94948918f1f3ef8a Reviewed-on: https://gerrit.libreoffice.org/35168 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc/generalfunction.hxx')
-rw-r--r--sc/inc/generalfunction.hxx104
1 files changed, 104 insertions, 0 deletions
diff --git a/sc/inc/generalfunction.hxx b/sc/inc/generalfunction.hxx
new file mode 100644
index 000000000000..0716f83e66d5
--- /dev/null
+++ b/sc/inc/generalfunction.hxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_SC_SHEET_GENERAL_FUNCTION_HXX
+#define INCLUDED_SC_SHEET_GENERAL_FUNCTION_HXX
+
+#include <com/sun/star/sheet/GeneralFunction.hpp>
+#include <com/sun/star/sheet/GeneralFunction2.hpp>
+
+/**
+ * the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2, which causes some type-safety issues.
+ * So abstract them behind the facade of this enum.
+ */
+enum class ScGeneralFunction
+{
+ /** nothing is calculated.
+ */
+ NONE = css::sheet::GeneralFunction_NONE,
+
+
+ /** function is determined automatically.
+
+ <p>If the values are all numerical, SUM is used, otherwise COUNT.</p>
+ */
+ AUTO = css::sheet::GeneralFunction_AUTO,
+
+
+ /** sum of all numerical values is calculated.
+ */
+ SUM = css::sheet::GeneralFunction_SUM,
+
+
+ /** all values, including non-numerical values, are counted.
+ */
+ COUNT = css::sheet::GeneralFunction_COUNT,
+
+
+ /** average of all numerical values is calculated.
+ */
+ AVERAGE = css::sheet::GeneralFunction_AVERAGE,
+
+
+ /** maximum value of all numerical values is calculated.
+ */
+ MAX = css::sheet::GeneralFunction_MAX,
+
+
+ /** minimum value of all numerical values is calculated.
+ */
+ MIN = css::sheet::GeneralFunction_MIN,
+
+
+ /** product of all numerical values is calculated.
+ */
+ PRODUCT = css::sheet::GeneralFunction_PRODUCT,
+
+
+ /** numerical values are counted.
+ */
+ COUNTNUMS = css::sheet::GeneralFunction_COUNTNUMS,
+
+
+ /** standard deviation is calculated based on a sample.
+ */
+ STDEV = css::sheet::GeneralFunction_STDEV,
+
+
+ /** standard deviation is calculated based on the entire population.
+ */
+ STDEVP = css::sheet::GeneralFunction_STDEVP,
+
+
+ /** variance is calculated based on a sample.
+ */
+ VAR = css::sheet::GeneralFunction_VAR,
+
+
+ /** variance is calculated based on the entire population.
+ */
+ VARP = css::sheet::GeneralFunction_VARP,
+
+ /**
+ * median of all numerical values is calculated.
+ * @since LibreOffice 5.3
+ */
+ MEDIAN = css::sheet::GeneralFunction2::MEDIAN
+};
+
+#endif