1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SVX_CHRTITEM_HXX 24 #define _SVX_CHRTITEM_HXX 25 26 // include --------------------------------------------------------------- 27 28 #include <svl/eitem.hxx> 29 #include "svx/svxdllapi.h" 30 31 //------------------------------------------------------------------------ 32 33 enum SvxChartStyle 34 { 35 CHSTYLE_2D_LINE, 36 CHSTYLE_2D_STACKEDLINE, 37 CHSTYLE_2D_PERCENTLINE, 38 CHSTYLE_2D_COLUMN, 39 CHSTYLE_2D_STACKEDCOLUMN, 40 CHSTYLE_2D_PERCENTCOLUMN, 41 CHSTYLE_2D_BAR, 42 CHSTYLE_2D_STACKEDBAR, 43 CHSTYLE_2D_PERCENTBAR, 44 CHSTYLE_2D_AREA, 45 CHSTYLE_2D_STACKEDAREA, 46 CHSTYLE_2D_PERCENTAREA, 47 CHSTYLE_2D_PIE, 48 CHSTYLE_3D_STRIPE, 49 CHSTYLE_3D_COLUMN, 50 CHSTYLE_3D_FLATCOLUMN, 51 CHSTYLE_3D_STACKEDFLATCOLUMN, 52 CHSTYLE_3D_PERCENTFLATCOLUMN, 53 CHSTYLE_3D_AREA, 54 CHSTYLE_3D_STACKEDAREA, 55 CHSTYLE_3D_PERCENTAREA, 56 CHSTYLE_3D_SURFACE, 57 CHSTYLE_3D_PIE, 58 CHSTYLE_2D_XY, 59 CHSTYLE_3D_XYZ, 60 CHSTYLE_2D_LINESYMBOLS, 61 CHSTYLE_2D_STACKEDLINESYM, 62 CHSTYLE_2D_PERCENTLINESYM, 63 CHSTYLE_2D_XYSYMBOLS, 64 CHSTYLE_3D_XYZSYMBOLS, 65 CHSTYLE_2D_DONUT1, 66 CHSTYLE_2D_DONUT2, 67 CHSTYLE_3D_BAR, 68 CHSTYLE_3D_FLATBAR, 69 CHSTYLE_3D_STACKEDFLATBAR, 70 CHSTYLE_3D_PERCENTFLATBAR, 71 CHSTYLE_2D_PIE_SEGOF1, 72 CHSTYLE_2D_PIE_SEGOFALL, 73 CHSTYLE_2D_NET, 74 CHSTYLE_2D_NET_SYMBOLS, 75 CHSTYLE_2D_NET_STACK, 76 CHSTYLE_2D_NET_SYMBOLS_STACK, 77 CHSTYLE_2D_NET_PERCENT, 78 CHSTYLE_2D_NET_SYMBOLS_PERCENT, 79 CHSTYLE_2D_CUBIC_SPLINE, 80 CHSTYLE_2D_CUBIC_SPLINE_SYMBOL, 81 CHSTYLE_2D_B_SPLINE, 82 CHSTYLE_2D_B_SPLINE_SYMBOL, 83 CHSTYLE_2D_CUBIC_SPLINE_XY, 84 CHSTYLE_2D_CUBIC_SPLINE_SYMBOL_XY, 85 CHSTYLE_2D_B_SPLINE_XY, 86 CHSTYLE_2D_B_SPLINE_SYMBOL_XY, 87 CHSTYLE_2D_XY_LINE, 88 CHSTYLE_2D_LINE_COLUMN, 89 CHSTYLE_2D_LINE_STACKEDCOLUMN, 90 CHSTYLE_2D_STOCK_1, 91 CHSTYLE_2D_STOCK_2, 92 CHSTYLE_2D_STOCK_3, 93 CHSTYLE_2D_STOCK_4, 94 CHSTYLE_ADDIN 95 }; 96 97 #define CHSTYLE_COUNT (CHSTYLE_ADDIN + 1) 98 99 enum SvxChartDataDescr 100 { 101 CHDESCR_NONE, 102 CHDESCR_VALUE, 103 CHDESCR_PERCENT, 104 CHDESCR_TEXT, 105 CHDESCR_TEXTANDPERCENT, 106 CHDESCR_NUMFORMAT_PERCENT, 107 CHDESCR_NUMFORMAT_VALUE, 108 CHDESCR_TEXTANDVALUE 109 }; 110 111 #define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1) 112 113 enum SvxChartTextOrder 114 { 115 CHTXTORDER_SIDEBYSIDE, 116 CHTXTORDER_UPDOWN, 117 CHTXTORDER_DOWNUP, 118 CHTXTORDER_AUTO 119 }; 120 121 #define CHTXTORDER_COUNT (CHTXTORDER_AUTO + 1) 122 123 enum SvxChartTextOrient 124 { 125 CHTXTORIENT_AUTOMATIC, 126 CHTXTORIENT_STANDARD, 127 CHTXTORIENT_BOTTOMTOP, 128 CHTXTORIENT_STACKED, 129 CHTXTORIENT_TOPBOTTOM 130 }; 131 132 #define CHTXTORIENT_COUNT (CHTXTORIENT_TOPBOTTOM + 1) 133 134 enum SvxChartKindError 135 { 136 CHERROR_NONE, 137 CHERROR_VARIANT, 138 CHERROR_SIGMA, 139 CHERROR_PERCENT, 140 CHERROR_BIGERROR, 141 CHERROR_CONST, 142 CHERROR_STDERROR, 143 CHERROR_RANGE 144 }; 145 146 #define CHERROR_COUNT (CHERROR_RANGE + 1) 147 148 enum SvxChartIndicate 149 { 150 CHINDICATE_NONE, 151 CHINDICATE_BOTH, 152 CHINDICATE_UP, 153 CHINDICATE_DOWN 154 }; 155 156 #define CHINDICATE_COUNT (CHINDICATE_DOWN + 1) 157 158 enum SvxChartRegress 159 { 160 CHREGRESS_NONE, 161 CHREGRESS_LINEAR, 162 CHREGRESS_LOG, 163 CHREGRESS_EXP, 164 CHREGRESS_POWER 165 }; 166 167 #define CHREGRESS_COUNT (CHREGRESS_POWER + 1) 168 169 //------------------------------------------------------------------ 170 171 class SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem 172 { 173 public: 174 TYPEINFO(); 175 SvxChartStyleItem(SvxChartStyle eStyle /*= CHSTYLE_2D_LINE*/, 176 sal_uInt16 nId ); 177 SvxChartStyleItem(SvStream& rIn, sal_uInt16 nId ); 178 179 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 180 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 181 GetValueCount() const182 sal_uInt16 GetValueCount() const { return CHSTYLE_COUNT; } GetValue() const183 SvxChartStyle GetValue() const 184 { return (SvxChartStyle)SfxEnumItem::GetValue(); } 185 }; 186 187 //------------------------------------------------------------------ 188 189 class SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem 190 { 191 public: 192 TYPEINFO(); 193 SvxChartRegressItem(SvxChartRegress eRegress /*= CHREGRESS_LINEAR*/, 194 sal_uInt16 nId ); 195 SvxChartRegressItem(SvStream& rIn, sal_uInt16 nId ); 196 197 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 198 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 199 GetValueCount() const200 sal_uInt16 GetValueCount() const { return CHREGRESS_COUNT; } GetValue() const201 SvxChartRegress GetValue() const 202 { return (SvxChartRegress)SfxEnumItem::GetValue(); } 203 sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const; 204 }; 205 206 //------------------------------------------------------------------ 207 208 class SVX_DLLPUBLIC SvxChartDataDescrItem : public SfxEnumItem 209 { 210 public: 211 TYPEINFO(); 212 SvxChartDataDescrItem(SvxChartDataDescr eDataDescr /*= CHDESCR_NONE*/, 213 sal_uInt16 nId ); 214 SvxChartDataDescrItem(SvStream& rIn, 215 sal_uInt16 nId ); 216 217 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 218 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 219 GetValueCount() const220 sal_uInt16 GetValueCount() const { return CHDESCR_COUNT; } GetValue() const221 SvxChartDataDescr GetValue() const 222 { return (SvxChartDataDescr)SfxEnumItem::GetValue(); } 223 }; 224 225 //------------------------------------------------------------------ 226 227 class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem 228 { 229 public: 230 TYPEINFO(); 231 SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= CHTXTORDER_SIDEBYSIDE*/, 232 sal_uInt16 nId ); 233 SvxChartTextOrderItem(SvStream& rIn, 234 sal_uInt16 nId ); 235 236 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 237 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 238 239 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 240 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 241 GetValueCount() const242 sal_uInt16 GetValueCount() const { return CHTXTORDER_COUNT; } GetValue() const243 SvxChartTextOrder GetValue() const 244 { return (SvxChartTextOrder)SfxEnumItem::GetValue(); } 245 }; 246 247 //------------------------------------------------------------------ 248 249 class SVX_DLLPUBLIC SvxChartTextOrientItem : public SfxEnumItem 250 { 251 public: 252 TYPEINFO(); 253 SvxChartTextOrientItem(SvxChartTextOrient /*eOrient = CHTXTORIENT_STANDARD*/, 254 sal_uInt16 nId ); 255 SvxChartTextOrientItem(SvStream& rIn, 256 sal_uInt16 nId ); 257 258 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 259 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 260 GetValueCount() const261 sal_uInt16 GetValueCount() const { return CHTXTORDER_COUNT; } GetValue() const262 SvxChartTextOrient GetValue() const 263 { return (SvxChartTextOrient)SfxEnumItem::GetValue(); } 264 }; 265 266 //------------------------------------------------------------------ 267 268 class SVX_DLLPUBLIC SvxChartKindErrorItem : public SfxEnumItem 269 { 270 public: 271 TYPEINFO(); 272 SvxChartKindErrorItem(SvxChartKindError /*eOrient = CHERROR_NONE*/, 273 sal_uInt16 nId ); 274 SvxChartKindErrorItem(SvStream& rIn, 275 sal_uInt16 nId ); 276 277 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 278 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 279 GetValueCount() const280 sal_uInt16 GetValueCount() const { return CHERROR_COUNT; } GetValue() const281 SvxChartKindError GetValue() const 282 { return (SvxChartKindError)SfxEnumItem::GetValue(); } 283 284 sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const; 285 }; 286 287 //------------------------------------------------------------------ 288 289 class SVX_DLLPUBLIC SvxChartIndicateItem : public SfxEnumItem 290 { 291 public: 292 TYPEINFO(); 293 SvxChartIndicateItem(SvxChartIndicate eOrient /*= CHINDICATE_NONE*/, 294 sal_uInt16 nId ); 295 SvxChartIndicateItem(SvStream& rIn, 296 sal_uInt16 nId ); 297 298 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 299 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 300 GetValueCount() const301 sal_uInt16 GetValueCount() const { return CHINDICATE_COUNT; } GetValue() const302 SvxChartIndicate GetValue() const 303 { return (SvxChartIndicate)SfxEnumItem::GetValue(); } 304 305 sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const; 306 }; 307 308 //------------------------------------------------------------------ 309 310 class SVX_DLLPUBLIC SvxDoubleItem : public SfxPoolItem 311 { 312 double fVal; 313 314 public: 315 TYPEINFO(); 316 SvxDoubleItem(double fValue /*= 0.0*/, sal_uInt16 nId ); 317 SvxDoubleItem(SvStream& rIn, sal_uInt16 nId ); 318 SvxDoubleItem(const SvxDoubleItem& rItem); 319 320 321 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 322 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 323 324 325 326 virtual String GetValueText() const; 327 virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, 328 SfxMapUnit eCoreMetric, 329 SfxMapUnit ePresMetric, 330 String &rText, const IntlWrapper * = 0) const; 331 332 virtual int operator == (const SfxPoolItem&) const; 333 virtual SfxPoolItem* Clone(SfxItemPool *pPool = NULL) const; 334 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVersion) const; 335 virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const; 336 337 virtual double GetMin() const; 338 virtual double GetMax() const; 339 340 virtual SfxFieldUnit GetUnit() const; 341 GetValue() const342 double GetValue() const { return fVal; } SetValue(double fNewVal)343 void SetValue(double fNewVal) { fVal = fNewVal; } 344 }; 345 346 #endif // _SVX_CHRTITEM_HXX 347 348