1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SVX_CHRTITEM_HXX 28 #define _SVX_CHRTITEM_HXX 29 30 // include --------------------------------------------------------------- 31 32 #include <svl/eitem.hxx> 33 #include "svx/svxdllapi.h" 34 35 //------------------------------------------------------------------------ 36 37 enum SvxChartStyle 38 { 39 CHSTYLE_2D_LINE, 40 CHSTYLE_2D_STACKEDLINE, 41 CHSTYLE_2D_PERCENTLINE, 42 CHSTYLE_2D_COLUMN, 43 CHSTYLE_2D_STACKEDCOLUMN, 44 CHSTYLE_2D_PERCENTCOLUMN, 45 CHSTYLE_2D_BAR, 46 CHSTYLE_2D_STACKEDBAR, 47 CHSTYLE_2D_PERCENTBAR, 48 CHSTYLE_2D_AREA, 49 CHSTYLE_2D_STACKEDAREA, 50 CHSTYLE_2D_PERCENTAREA, 51 CHSTYLE_2D_PIE, 52 CHSTYLE_3D_STRIPE, 53 CHSTYLE_3D_COLUMN, 54 CHSTYLE_3D_FLATCOLUMN, 55 CHSTYLE_3D_STACKEDFLATCOLUMN, 56 CHSTYLE_3D_PERCENTFLATCOLUMN, 57 CHSTYLE_3D_AREA, 58 CHSTYLE_3D_STACKEDAREA, 59 CHSTYLE_3D_PERCENTAREA, 60 CHSTYLE_3D_SURFACE, 61 CHSTYLE_3D_PIE, 62 CHSTYLE_2D_XY, 63 CHSTYLE_3D_XYZ, 64 CHSTYLE_2D_LINESYMBOLS, 65 CHSTYLE_2D_STACKEDLINESYM, 66 CHSTYLE_2D_PERCENTLINESYM, 67 CHSTYLE_2D_XYSYMBOLS, 68 CHSTYLE_3D_XYZSYMBOLS, 69 CHSTYLE_2D_DONUT1, 70 CHSTYLE_2D_DONUT2, 71 CHSTYLE_3D_BAR, 72 CHSTYLE_3D_FLATBAR, 73 CHSTYLE_3D_STACKEDFLATBAR, 74 CHSTYLE_3D_PERCENTFLATBAR, 75 CHSTYLE_2D_PIE_SEGOF1, 76 CHSTYLE_2D_PIE_SEGOFALL, 77 CHSTYLE_2D_NET, 78 CHSTYLE_2D_NET_SYMBOLS, 79 CHSTYLE_2D_NET_STACK, 80 CHSTYLE_2D_NET_SYMBOLS_STACK, 81 CHSTYLE_2D_NET_PERCENT, 82 CHSTYLE_2D_NET_SYMBOLS_PERCENT, 83 CHSTYLE_2D_CUBIC_SPLINE, 84 CHSTYLE_2D_CUBIC_SPLINE_SYMBOL, 85 CHSTYLE_2D_B_SPLINE, 86 CHSTYLE_2D_B_SPLINE_SYMBOL, 87 CHSTYLE_2D_CUBIC_SPLINE_XY, 88 CHSTYLE_2D_CUBIC_SPLINE_SYMBOL_XY, 89 CHSTYLE_2D_B_SPLINE_XY, 90 CHSTYLE_2D_B_SPLINE_SYMBOL_XY, 91 CHSTYLE_2D_XY_LINE, 92 CHSTYLE_2D_LINE_COLUMN, 93 CHSTYLE_2D_LINE_STACKEDCOLUMN, 94 CHSTYLE_2D_STOCK_1, 95 CHSTYLE_2D_STOCK_2, 96 CHSTYLE_2D_STOCK_3, 97 CHSTYLE_2D_STOCK_4, 98 CHSTYLE_ADDIN 99 }; 100 101 #define CHSTYLE_COUNT (CHSTYLE_ADDIN + 1) 102 103 enum SvxChartDataDescr 104 { 105 CHDESCR_NONE, 106 CHDESCR_VALUE, 107 CHDESCR_PERCENT, 108 CHDESCR_TEXT, 109 CHDESCR_TEXTANDPERCENT, 110 CHDESCR_NUMFORMAT_PERCENT, 111 CHDESCR_NUMFORMAT_VALUE, 112 CHDESCR_TEXTANDVALUE 113 }; 114 115 #define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1) 116 117 enum SvxChartTextOrder 118 { 119 CHTXTORDER_SIDEBYSIDE, 120 CHTXTORDER_UPDOWN, 121 CHTXTORDER_DOWNUP, 122 CHTXTORDER_AUTO 123 }; 124 125 #define CHTXTORDER_COUNT (CHTXTORDER_AUTO + 1) 126 127 enum SvxChartTextOrient 128 { 129 CHTXTORIENT_AUTOMATIC, 130 CHTXTORIENT_STANDARD, 131 CHTXTORIENT_BOTTOMTOP, 132 CHTXTORIENT_STACKED, 133 CHTXTORIENT_TOPBOTTOM 134 }; 135 136 #define CHTXTORIENT_COUNT (CHTXTORIENT_TOPBOTTOM + 1) 137 138 enum SvxChartKindError 139 { 140 CHERROR_NONE, 141 CHERROR_VARIANT, 142 CHERROR_SIGMA, 143 CHERROR_PERCENT, 144 CHERROR_BIGERROR, 145 CHERROR_CONST, 146 CHERROR_STDERROR, 147 CHERROR_RANGE 148 }; 149 150 #define CHERROR_COUNT (CHERROR_RANGE + 1) 151 152 enum SvxChartIndicate 153 { 154 CHINDICATE_NONE, 155 CHINDICATE_BOTH, 156 CHINDICATE_UP, 157 CHINDICATE_DOWN 158 }; 159 160 #define CHINDICATE_COUNT (CHINDICATE_DOWN + 1) 161 162 enum SvxChartRegress 163 { 164 CHREGRESS_NONE, 165 CHREGRESS_LINEAR, 166 CHREGRESS_LOG, 167 CHREGRESS_EXP, 168 CHREGRESS_POWER 169 }; 170 171 #define CHREGRESS_COUNT (CHREGRESS_POWER + 1) 172 173 //------------------------------------------------------------------ 174 175 class SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem 176 { 177 public: 178 TYPEINFO(); 179 SvxChartStyleItem(SvxChartStyle eStyle /*= CHSTYLE_2D_LINE*/, 180 sal_uInt16 nId ); 181 SvxChartStyleItem(SvStream& rIn, sal_uInt16 nId ); 182 183 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 184 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 185 186 sal_uInt16 GetValueCount() const { return CHSTYLE_COUNT; } 187 SvxChartStyle GetValue() const 188 { return (SvxChartStyle)SfxEnumItem::GetValue(); } 189 }; 190 191 //------------------------------------------------------------------ 192 193 class SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem 194 { 195 public: 196 TYPEINFO(); 197 SvxChartRegressItem(SvxChartRegress eRegress /*= CHREGRESS_LINEAR*/, 198 sal_uInt16 nId ); 199 SvxChartRegressItem(SvStream& rIn, sal_uInt16 nId ); 200 201 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 202 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 203 204 sal_uInt16 GetValueCount() const { return CHREGRESS_COUNT; } 205 SvxChartRegress GetValue() const 206 { return (SvxChartRegress)SfxEnumItem::GetValue(); } 207 sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const; 208 }; 209 210 //------------------------------------------------------------------ 211 212 class SVX_DLLPUBLIC SvxChartDataDescrItem : public SfxEnumItem 213 { 214 public: 215 TYPEINFO(); 216 SvxChartDataDescrItem(SvxChartDataDescr eDataDescr /*= CHDESCR_NONE*/, 217 sal_uInt16 nId ); 218 SvxChartDataDescrItem(SvStream& rIn, 219 sal_uInt16 nId ); 220 221 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 222 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 223 224 sal_uInt16 GetValueCount() const { return CHDESCR_COUNT; } 225 SvxChartDataDescr GetValue() const 226 { return (SvxChartDataDescr)SfxEnumItem::GetValue(); } 227 }; 228 229 //------------------------------------------------------------------ 230 231 class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem 232 { 233 public: 234 TYPEINFO(); 235 SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= CHTXTORDER_SIDEBYSIDE*/, 236 sal_uInt16 nId ); 237 SvxChartTextOrderItem(SvStream& rIn, 238 sal_uInt16 nId ); 239 240 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 241 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 242 243 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 244 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 245 246 sal_uInt16 GetValueCount() const { return CHTXTORDER_COUNT; } 247 SvxChartTextOrder GetValue() const 248 { return (SvxChartTextOrder)SfxEnumItem::GetValue(); } 249 }; 250 251 //------------------------------------------------------------------ 252 253 class SVX_DLLPUBLIC SvxChartTextOrientItem : public SfxEnumItem 254 { 255 public: 256 TYPEINFO(); 257 SvxChartTextOrientItem(SvxChartTextOrient /*eOrient = CHTXTORIENT_STANDARD*/, 258 sal_uInt16 nId ); 259 SvxChartTextOrientItem(SvStream& rIn, 260 sal_uInt16 nId ); 261 262 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 263 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 264 265 sal_uInt16 GetValueCount() const { return CHTXTORDER_COUNT; } 266 SvxChartTextOrient GetValue() const 267 { return (SvxChartTextOrient)SfxEnumItem::GetValue(); } 268 }; 269 270 //------------------------------------------------------------------ 271 272 class SVX_DLLPUBLIC SvxChartKindErrorItem : public SfxEnumItem 273 { 274 public: 275 TYPEINFO(); 276 SvxChartKindErrorItem(SvxChartKindError /*eOrient = CHERROR_NONE*/, 277 sal_uInt16 nId ); 278 SvxChartKindErrorItem(SvStream& rIn, 279 sal_uInt16 nId ); 280 281 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 282 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 283 284 sal_uInt16 GetValueCount() const { return CHERROR_COUNT; } 285 SvxChartKindError GetValue() const 286 { return (SvxChartKindError)SfxEnumItem::GetValue(); } 287 288 sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const; 289 }; 290 291 //------------------------------------------------------------------ 292 293 class SVX_DLLPUBLIC SvxChartIndicateItem : public SfxEnumItem 294 { 295 public: 296 TYPEINFO(); 297 SvxChartIndicateItem(SvxChartIndicate eOrient /*= CHINDICATE_NONE*/, 298 sal_uInt16 nId ); 299 SvxChartIndicateItem(SvStream& rIn, 300 sal_uInt16 nId ); 301 302 virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; 303 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; 304 305 sal_uInt16 GetValueCount() const { return CHINDICATE_COUNT; } 306 SvxChartIndicate GetValue() const 307 { return (SvxChartIndicate)SfxEnumItem::GetValue(); } 308 309 sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const; 310 }; 311 312 //------------------------------------------------------------------ 313 314 class SVX_DLLPUBLIC SvxDoubleItem : public SfxPoolItem 315 { 316 double fVal; 317 318 public: 319 TYPEINFO(); 320 SvxDoubleItem(double fValue /*= 0.0*/, sal_uInt16 nId ); 321 SvxDoubleItem(SvStream& rIn, sal_uInt16 nId ); 322 SvxDoubleItem(const SvxDoubleItem& rItem); 323 324 325 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 326 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 327 328 329 330 virtual String GetValueText() const; 331 virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, 332 SfxMapUnit eCoreMetric, 333 SfxMapUnit ePresMetric, 334 String &rText, const IntlWrapper * = 0) const; 335 336 virtual int operator == (const SfxPoolItem&) const; 337 virtual SfxPoolItem* Clone(SfxItemPool *pPool = NULL) const; 338 virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVersion) const; 339 virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const; 340 341 virtual double GetMin() const; 342 virtual double GetMax() const; 343 344 virtual SfxFieldUnit GetUnit() const; 345 346 double GetValue() const { return fVal; } 347 void SetValue(double fNewVal) { fVal = fNewVal; } 348 }; 349 350 #endif // _SVX_CHRTITEM_HXX 351 352