summaryrefslogtreecommitdiff
path: root/sc/inc/grouparealistener.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-12 22:18:49 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-18 08:31:55 -0500
commit2030b9ac6c68ba6f15b0283e0b4e57ae49bd67b0 (patch)
treedc7ad2b2f890ea0ac614d7820c2e655c84327c3f /sc/inc/grouparealistener.hxx
parent192f6a41444b62feae03185975c120f770e2938f (diff)
Dedicated listener type tailored for formula groups.
Right now, it's only used when loading an xlsx file. But eventually this one should be used everywhere. Change-Id: I216c3a9a33c4b8040e8284d59299e0637471fb50
Diffstat (limited to 'sc/inc/grouparealistener.hxx')
-rw-r--r--sc/inc/grouparealistener.hxx73
1 files changed, 73 insertions, 0 deletions
diff --git a/sc/inc/grouparealistener.hxx b/sc/inc/grouparealistener.hxx
new file mode 100644
index 000000000000..6301023d8093
--- /dev/null
+++ b/sc/inc/grouparealistener.hxx
@@ -0,0 +1,73 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_SC_GROUPAREALISTENER_HXX
+#define INCLUDED_SC_GROUPAREALISTENER_HXX
+
+#include <address.hxx>
+
+#include <svl/listener.hxx>
+
+class ScFormulaCell;
+
+namespace sc {
+
+class BulkDataHint;
+
+class FormulaGroupAreaListener : public SvtListener
+{
+ ScRange maRange;
+ ScFormulaCell** mppTopCell;
+ SCROW mnGroupLen;
+ bool mbStartFixed;
+ bool mbEndFixed;
+
+ FormulaGroupAreaListener(); // disabled
+
+public:
+ FormulaGroupAreaListener(
+ const ScRange& rRange, ScFormulaCell** ppTopCell, SCROW nGroupLen, bool bStartFixed, bool bEndFixed );
+
+ ScRange getListeningRange() const;
+
+ virtual void Notify( const SfxHint& rHint ) SAL_OVERRIDE;
+
+ /**
+ * Given the position of a changed cell, collect all formula cells that
+ * need to be notified of the change.
+ *
+ * @param rPos position of changed cell.
+ * @param rCells all formula cells that need to be notified are put into
+ * this container.
+ */
+ void collectFormulaCells( const ScAddress& rPos, std::vector<ScFormulaCell*>& rCells ) const;
+
+ /**
+ * Given the row span of changed cells within a single column, collect all
+ * formula cells that need to be notified of the change.
+ *
+ * @param nTab sheet position of the changed cell span.
+ * @param nCol column position of the changed cell span.
+ * @param nRow1 top row position of the changed cell span.
+ * @param nRow2 bottom row position of the changed cell span.
+ * @param rCells all formula cells that need to be notified are put into
+ * this container.
+ */
+ void collectFormulaCells( SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, std::vector<ScFormulaCell*>& rCells ) const;
+
+private:
+ void notifyCellChange( const SfxHint& rHint, const ScAddress& rPos );
+ void notifyBulkChange( const BulkDataHint& rHint );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */