/* -*- 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/.
*/
class ScFormulaCell; class ScTokenArray; struct ScDataBarInfo; class BitmapEx;
// don't change the order // they are also used in the dialog to determine the position // in the list box enum ScColorScaleEntryType
{
COLORSCALE_AUTO,
COLORSCALE_MIN,
COLORSCALE_MAX,
COLORSCALE_PERCENTILE,
COLORSCALE_VALUE,
COLORSCALE_PERCENT,
COLORSCALE_FORMULA,
};
class ScColorScaleEntry
{ private: double mnVal;
std::unique_ptr<ScFormulaCell> mpCell;
std::unique_ptr<ScFormulaListener> mpListener;
ScConditionalFormat* mpFormat;
Color maColor;
ScColorScaleEntryType meType;
ScConditionMode meMode;
if(r.mpLowerLimit)
mpLowerLimit.reset( new ScColorScaleEntry(*r.mpLowerLimit)); else
mpLowerLimit.reset(new ScColorScaleEntry()); if(r.mpUpperLimit)
mpUpperLimit.reset( new ScColorScaleEntry(*r.mpUpperLimit)); else
mpUpperLimit.reset(new ScColorScaleEntry());
}
/** * Color for all Positive Values and if mbNeg == false also for negative ones
*/
Color maPositiveColor; /** * Specifies the color for negative values. This is optional and depends on mbNeg. * * Default color is 0xFF0000, this value is not set
*/
std::optional<Color> mxNegativeColor; /** * Color of the axis if used * Default color is black
*/
Color maAxisColor; /** * Paint the bars with gradient. If this is used the default is to draw with * borders. * * Default is true
*/ bool mbGradient; /** * Use different color for negative values. Color is specified in * mpNegativeColor and defaults to 0xFF0000 * * Default is true
*/ bool mbNeg; //differentiate between negative values /** * Paint negative values into the same direction as positive values * If false we will set the mid point according to the upper and lower limit and negative * values are painted to the left and positive to the right * * Default is false
*/
databar::ScAxisPosition meAxisPosition; /** * Minimal length of a databar in percent of cell length * Value has to be in the range [0, 100)
*/ double mnMinLength; /** * Maximal length of a databar in percent of cell length * Value has to be in the range (0, 100]
*/ double mnMaxLength;
/** * If TRUE we only show the bar and not the value
*/ bool mbOnlyBar;
/** * Makes sure that the maColorScales contain at least 2 entries. * Should be called when it is not sure that the format is valid.
*/ void EnsureSize();
};
class SAL_DLLPUBLIC_RTTI ScDataBarFormat final : public ScColorFormat
{ public:
SC_DLLPUBLIC ScDataBarFormat(ScDocument& rDoc);
ScDataBarFormat(ScDocument& rDoc, const ScDataBarFormat& rFormat); virtual ScColorFormat* Clone(ScDocument& rDoc) const override;
/** * Makes sure that the mpFormatData does not contain valid entries. * Should be called when it is not sure that the format is valid.
*/ void EnsureSize();
struct ScIconSetFormatData
{
ScIconSetType eIconSetType; bool mbShowValue; /** * Specifies whether the icons should be shown in reverse order
*/ bool mbReverse; typedef std::vector<std::unique_ptr<ScColorScaleEntry, o3tl::default_delete<ScColorScaleEntry>>> Entries_t;
Entries_t m_Entries; bool mbCustom; // the std::pair points to exactly one image // std..pair::second == -1 means no image
std::vector<std::pair<ScIconSetType, sal_Int32> > maCustomVector;
/** * Makes sure that the mpFormatData does not contain valid entries. * Should be called when it is not sure that the format is valid.
*/ void EnsureSize();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.