LibreOffice Module svx (master)  1
chrtitem.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_SVX_CHRTITEM_HXX
20 #define INCLUDED_SVX_CHRTITEM_HXX
21 
22 #include <rtl/ustring.hxx>
23 #include <sal/types.h>
24 #include <svl/eitem.hxx>
25 #include <svl/poolitem.hxx>
26 #include <svx/svxdllapi.h>
27 
28 class IntlWrapper;
29 class SfxItemPool;
30 
32 {
33  SideBySide,
34  UpDown,
35  DownUp,
36  Auto
37 };
38 
39 #define CHTXTORDER_COUNT (sal_uInt16(SvxChartTextOrder::Auto) + 1)
40 
42 {
43  NONE,
44  Variant,
45  Sigma,
46  Percent,
47  BigError,
48  Const,
49  StdError,
50  Range
51 };
52 
53 #define CHERROR_COUNT (sal_uInt16(SvxChartKindError::Range) + 1)
54 
55 enum class SvxChartIndicate
56 {
57  NONE,
58  Both,
59  Up,
60  Down
61 };
62 
63 #define CHINDICATE_COUNT (sal_uInt16(SvxChartIndicate::Down) + 1)
64 
65 enum class SvxChartRegress
66 {
67  NONE,
68  Linear,
69  Log,
70  Exp,
71  Power,
72  Polynomial,
74  MeanValue,
75  Unknown
76 };
77 
78 #define CHREGRESS_COUNT (sal_uInt16(SvxChartRegress::Unknown) + 1)
79 
80 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartRegressItem final : public SfxEnumItem<SvxChartRegress>
81 {
82 public:
83  SvxChartRegressItem(SvxChartRegress eRegress /*= SvxChartRegress::Linear*/,
84  sal_uInt16 nId );
85 
86  virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
87 
88  sal_uInt16 GetValueCount() const override { return CHREGRESS_COUNT; }
89 };
90 
91 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartTextOrderItem final : public SfxEnumItem<SvxChartTextOrder>
92 {
93 public:
94  SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= SvxChartTextOrder::SideBySide*/,
95  sal_uInt16 nId );
96 
97  virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
98 
99  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
100  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
101 
102  sal_uInt16 GetValueCount() const override { return CHTXTORDER_COUNT; }
103 };
104 
105 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartKindErrorItem final : public SfxEnumItem<SvxChartKindError>
106 {
107 public:
108  SvxChartKindErrorItem(SvxChartKindError /*eOrient = SvxChartKindError::NONE*/,
109  sal_uInt16 nId );
110 
111  virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
112 
113  sal_uInt16 GetValueCount() const override { return CHERROR_COUNT; }
114 };
115 
116 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartIndicateItem final : public SfxEnumItem<SvxChartIndicate>
117 {
118 public:
119  SvxChartIndicateItem(SvxChartIndicate eOrient /*= SvxChartIndicate::NONE*/,
120  sal_uInt16 nId );
121 
122  virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
123 
124  sal_uInt16 GetValueCount() const override { return CHINDICATE_COUNT; }
125 };
126 
128 {
129  double fVal;
130 
131 public:
132  static SfxPoolItem* CreateDefault();
133  SvxDoubleItem(double fValue /*= 0.0*/, sal_uInt16 nId );
134  SvxDoubleItem(const SvxDoubleItem& rItem);
135 
136  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
137  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
138 
139  virtual bool GetPresentation(SfxItemPresentation ePres,
140  MapUnit eCoreMetric,
141  MapUnit ePresMetric,
142  OUString &rText, const IntlWrapper&) const override;
143 
144  virtual bool operator == (const SfxPoolItem&) const override;
145  virtual SfxPoolItem* Clone(SfxItemPool *pPool = nullptr) const override;
146 
147  double GetValue() const { return fVal; }
148 };
149 
150 #endif // INCLUDED_SVX_CHRTITEM_HXX
151 
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxChartRegress
Definition: chrtitem.hxx:65
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8) override
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
#define CHREGRESS_COUNT
Definition: chrtitem.hxx:78
sal_uInt16 GetValueCount() const override
Definition: chrtitem.hxx:113
sal_Int16 nId
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
SvxChartTextOrder
Definition: chrtitem.hxx:31
sal_uInt16 GetValueCount() const override
Definition: chrtitem.hxx:102
#define CHTXTORDER_COUNT
Definition: chrtitem.hxx:39
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
#define CHINDICATE_COUNT
Definition: chrtitem.hxx:63
sal_uInt16 GetValueCount() const override
Definition: chrtitem.hxx:88
double GetValue() const
Definition: chrtitem.hxx:147
SfxItemPresentation
sal_uInt16 GetValueCount() const override
Definition: chrtitem.hxx:124
SvxChartIndicate
Definition: chrtitem.hxx:55
SvxChartKindError
Definition: chrtitem.hxx:41
#define SAL_WARN_UNUSED
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8=0) const override
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
unsigned char sal_uInt8
MapUnit
#define CHERROR_COUNT
Definition: chrtitem.hxx:53