summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-05-08 06:26:30 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-05-09 03:02:35 +0200
commit765c95e2bf85593d256683a15a55e097efb94b52 (patch)
treec09ee1e60fe7e64cc416e3d94db180511562af9a /sc/inc
parente6afb05329dfc5774c6955076717bff5a331ecc5 (diff)
add initial code for color scales
Change-Id: Iedb82a17fb7f7e3d16e86dc2a451c8aac4be9149
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/colorscale.hxx89
1 files changed, 89 insertions, 0 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
new file mode 100644
index 000000000000..a384739ca482
--- /dev/null
+++ b/sc/inc/colorscale.hxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <tools/color.hxx>
+#include <rangelst.hxx>
+
+//TODO: merge this with conditio.hxx
+
+class ScDocument;
+
+class ScColorScaleEntry
+{
+private:
+ double mnVal;
+ Color maColor;
+public:
+ ScColorScaleEntry(double nVal, const Color& rCol);
+ ScColorScaleEntry(const ScColorScaleEntry& rEntry);
+
+ const Color& GetColor() const;
+ double GetValue() const;
+};
+
+class ScColorScaleFormat
+{
+private:
+ ScRangeList maRange;
+ ScDocument* mpDoc;
+ typedef boost::ptr_vector<ScColorScaleEntry> ColorScaleEntries;
+ ColorScaleEntries maColorScales;
+public:
+ Color* GetColor(const ScAddress& rAddr) const;
+
+ typedef ColorScaleEntries::iterator iterator;
+ typedef ColorScaleEntries::const_iterator const_iterator;
+ iterator begin();
+ const_iterator begin() const;
+ iterator end();
+ const_iterator end() const;
+};
+
+class ScColorScaleFormatList
+{
+private:
+ typedef boost::ptr_vector<ScColorScaleFormat> ColorScaleFormatContainer;
+ boost::ptr_vector<ScColorScaleFormat> maColorScaleFormats;
+public:
+ ScColorScaleFormatList() {};
+
+ typedef ColorScaleFormatContainer::iterator iterator;
+ typedef ColorScaleFormatContainer::const_iterator const_iterator;
+
+ ScColorScaleFormat* GetFormat(sal_uInt32 nFormat);
+
+ iterator begin();
+ const_iterator begin() const;
+ iterator end();
+ const_iterator end() const;
+
+ size_t size() const;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */