| 1 |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* This file is part of the LibreOffice project. |
| 4 |
* |
| 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/. |
| 8 |
* |
| 9 |
* This file incorporates work covered by the following license notice: |
| 10 |
* |
| 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 . |
| 18 |
*/ |
| 19 |
#pragma once |
| 20 |
|
| 21 |
#include <memory> |
| 22 |
#include <tools/link.hxx> |
| 23 |
#include <svl/itemset.hxx> |
| 24 |
#include <svx/chrtitem.hxx> |
| 25 |
#include <RangeSelectionListener.hxx> |
| 26 |
#include <rtl/ref.hxx> |
| 27 |
|
| 28 |
namespace weld { class Builder; } |
| 29 |
namespace weld { class Button; } |
| 30 |
namespace weld { class CheckButton; } |
| 31 |
namespace weld { class ComboBox; } |
| 32 |
namespace weld { class DialogController; } |
| 33 |
namespace weld { class Entry; } |
| 34 |
namespace weld { class Frame; } |
| 35 |
namespace weld { class Image; } |
| 36 |
namespace weld { class Label; } |
| 37 |
namespace weld { class MetricSpinButton; } |
| 38 |
namespace weld { class RadioButton; } |
| 39 |
namespace weld { class Toggleable; } |
| 40 |
namespace weld { class Widget; } |
| 41 |
|
| 42 |
namespace chart |
| 43 |
{ |
| 44 |
class ChartModel; |
| 45 |
class RangeSelectionHelper; |
| 46 |
|
| 47 |
class ErrorBarResources final : public RangeSelectionListenerParent |
| 48 |
{ |
| 49 |
public: |
| 50 |
enum tErrorBarType |
| 51 |
{ |
| 52 |
ERROR_BAR_X, |
| 53 |
ERROR_BAR_Y |
| 54 |
}; |
| 55 |
|
| 56 |
ErrorBarResources( |
| 57 |
weld::Builder* pParent, weld::DialogController* pControllerDialog, const SfxItemSet& rInAttrs, bool bNoneAvailable, chart::ErrorBarResources::tErrorBarType eType = ERROR_BAR_Y); |
| 58 |
~ErrorBarResources(); |
| 59 |
|
| 60 |
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ); |
| 61 |
void SetErrorBarType( tErrorBarType eNewType ); |
| 62 |
void SetChartDocumentForRangeChoosing( |
| 63 |
const rtl::Reference<::chart::ChartModel> & xChartDocument ); |
| 64 |
void Reset(const SfxItemSet& rInAttrs); |
| 65 |
void FillItemSet(SfxItemSet& rOutAttrs) const; |
| 66 |
|
| 67 |
void FillValueSets(); |
| 68 |
|
| 69 |
// ____ RangeSelectionListenerParent ____ |
| 70 |
virtual void listeningFinished( const OUString & rNewRange ) override; |
| 71 |
virtual void disposingRangeSelection() override; |
| 72 |
|
| 73 |
private: |
| 74 |
SvxChartKindError m_eErrorKind; |
| 75 |
SvxChartIndicate m_eIndicate; |
| 76 |
|
| 77 |
bool m_bErrorKindUnique; |
| 78 |
bool m_bIndicatorUnique; |
| 79 |
bool m_bRangePosUnique; |
| 80 |
bool m_bRangeNegUnique; |
| 81 |
|
| 82 |
tErrorBarType m_eErrorBarType; |
| 83 |
sal_uInt16 m_nConstDecimalDigits; |
| 84 |
sal_Int64 m_nConstSpinSize; |
| 85 |
double m_fPlusValue; |
| 86 |
double m_fMinusValue; |
| 87 |
|
| 88 |
weld::DialogController* m_pController; |
| 89 |
std::unique_ptr< RangeSelectionHelper > m_apRangeSelectionHelper; |
| 90 |
weld::Entry* m_pCurrentRangeChoosingField; |
| 91 |
bool m_bHasInternalDataProvider; |
| 92 |
bool m_bEnableDataTableDialog; |
| 93 |
|
| 94 |
|
| 95 |
// category |
| 96 |
std::unique_ptr<weld::RadioButton> m_xRbNone; |
| 97 |
std::unique_ptr<weld::RadioButton> m_xRbConst; |
| 98 |
std::unique_ptr<weld::RadioButton> m_xRbPercent; |
| 99 |
std::unique_ptr<weld::RadioButton> m_xRbFunction; |
| 100 |
std::unique_ptr<weld::RadioButton> m_xRbRange; |
| 101 |
std::unique_ptr<weld::ComboBox> m_xLbFunction; |
| 102 |
|
| 103 |
// parameters |
| 104 |
std::unique_ptr<weld::Frame> m_xFlParameters; |
| 105 |
std::unique_ptr<weld::Widget> m_xBxPositive; |
| 106 |
std::unique_ptr<weld::MetricSpinButton> m_xMfPositive; |
| 107 |
std::unique_ptr<weld::Entry> m_xEdRangePositive; |
| 108 |
std::unique_ptr<weld::Button> m_xIbRangePositive; |
| 109 |
std::unique_ptr<weld::Widget> m_xBxNegative; |
| 110 |
std::unique_ptr<weld::MetricSpinButton> m_xMfNegative; |
| 111 |
std::unique_ptr<weld::Entry> m_xEdRangeNegative; |
| 112 |
std::unique_ptr<weld::Button> m_xIbRangeNegative; |
| 113 |
std::unique_ptr<weld::CheckButton> m_xCbSyncPosNeg; |
| 114 |
|
| 115 |
// indicator |
| 116 |
std::unique_ptr<weld::RadioButton> m_xRbBoth; |
| 117 |
std::unique_ptr<weld::RadioButton> m_xRbPositive; |
| 118 |
std::unique_ptr<weld::RadioButton> m_xRbNegative; |
| 119 |
std::unique_ptr<weld::Image> m_xFiBoth; |
| 120 |
std::unique_ptr<weld::Image> m_xFiPositive; |
| 121 |
std::unique_ptr<weld::Image> m_xFiNegative; |
| 122 |
|
| 123 |
std::unique_ptr<weld::Label> m_xUIStringPos; |
| 124 |
std::unique_ptr<weld::Label> m_xUIStringNeg; |
| 125 |
std::unique_ptr<weld::Label> m_xUIStringRbRange; |
| 126 |
|
| 127 |
DECL_LINK( CategoryChosen, weld::Toggleable&, void ); |
| 128 |
DECL_LINK( CategoryChosen2, weld::ComboBox&, void ); |
| 129 |
DECL_LINK( SynchronizePosAndNeg, weld::Toggleable&, void ); |
| 130 |
DECL_LINK( PosValueChanged, weld::MetricSpinButton&, void ); |
| 131 |
DECL_LINK( IndicatorChanged, weld::Toggleable&, void ); |
| 132 |
DECL_LINK( ChooseRange, weld::Button&, void ); |
| 133 |
DECL_LINK( RangeChanged, weld::Entry&, void ); |
| 134 |
|
| 135 |
void UpdateControlStates(); |
| 136 |
void isRangeFieldContentValid(weld::Entry& rEdit); |
| 137 |
}; |
| 138 |
|
| 139 |
} //namespace chart |
| 140 |
|
| 141 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |