Mobile API Reference  MicroStrategy 2019
FormatManager.h
Go to the documentation of this file.
1 /*
2  * FormatManager.h
3  * IPhoneChart
4  *
5  * Created by dong shi on 3/23/10.
6  * Copyright 2010 __MyCompanyName__. All rights reserved.
7  *
8  */
9 #ifndef MsiChart_FormatManager_h
10 #define MsiChart_FormatManager_h
11 #ifndef _VE_CE
12 #import "DSSTemplate.h"
13 #import "DSSCellFmtData.h"
14 #import "Enums.h"
15 #include "FormatManagerHelper.h"
16 #else
17 #include "FormatManagerWINHelper.h"
18 #endif
19 #include "DatasetHelper.h"
20 #include "../Common.h"
21 #include "FormatInfo.h"
22 #include <set>
23 
24 class CComVariant;
25 namespace MsiChart
26 {
27 
28 #ifdef _VE_CE
29  typedef enum _ThemeType{
31  THEMETYPE_BLACK = 0,
33  }ThemeType;
34 #endif
35 
36  typedef enum
37  {
43  GA_DATA_NOMETRIC, //with no metric defined on template
44  GA_NON_DATA, //ITEM 1-3 + 5.
48  }GRID_AREA;
49 
50  typedef enum
51  {
53  DssAxisShow = 0x01,
60 
61 
62  typedef enum {
63  FRT_NORMAL = -1,
64  FRT_GRAPH = 0,
65  FRT_GRID = 1,
66  FRT_OTHER = 2, //< TO BE ADDED.
68 
69  static const int MaxWebMajorGraphTypes = 25;
70 
71  static const int GraphTypeMappingTable[MaxWebMajorGraphTypes][2] =
72  {
98  };
99 
100  //struct: Graph Property Key
102  {
107 
108  GraphPropertyKey(Int32 iPropertyId, Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId)
109  : mPropertyId(iPropertyId), mObjectId(iObjectId), mSeriesId(iSeriesId), mGroupId(iGroupId)
110  {}
111 
112  GraphPropertyKey(Int32 iPropertyId, TripleId& iTripleId)
113  : mPropertyId(iPropertyId), mObjectId(iTripleId.mObjectId),
114  mSeriesId(iTripleId.mSeriesId), mGroupId(iTripleId.mGroupId)
115  {}
116 
118  {
119  if (this == &lRight)
120  return true;
121  bool lIsIdentical = (mPropertyId == lRight.mPropertyId) && (mObjectId == lRight.mObjectId) &&
122  (mSeriesId == lRight.mSeriesId) /*&& (mGroupId == lRight.mGroupId)*/;
123  return lIsIdentical;
124  }
125 
126  bool BelongTo(GraphPropertyKey& lRight) const
127  {
128  if (mSeriesId == -3 && lRight.mSeriesId != -3)
129  return false;
130  return (mPropertyId == lRight.mPropertyId) && (mObjectId == lRight.mObjectId) && (lRight.mSeriesId == -3);
131  }
132  };
133 
134  struct KeyCompare
135  {
136  bool operator()(const GraphPropertyKey& lLeft, const GraphPropertyKey& lRight) const
137  {
138  if (lLeft.mPropertyId < lRight.mPropertyId)
139  return true;
140  if (lLeft.mPropertyId > lRight.mPropertyId)
141  return false;
142 
143 
144  if (lLeft.mObjectId < lRight.mObjectId)
145  return true;
146  if (lLeft.mObjectId > lRight.mObjectId)
147  return false;
148 
149  return (lLeft.mSeriesId < lRight.mSeriesId);
150  }
151  };
152 
153  //class Format Manager:
154  class ChartContext;
155  class BaseFormatting;
156  struct ChartAdvFormat;
158  {
159  public:
160  //Ptr
161  typedef FormatManager* Ptr; //to be commented
162  //typedef std::vector<std::vector<Int32> > SubTotalMatrix;
163  typedef std::map<Int32, Int32> SubTotalMap;
164  typedef std::map<GraphPropertyKey, CComVariant, KeyCompare> GraphPropertyKeyMap;
165  //Ctor & Dtor
166  FormatManager();
167 #ifndef _VE_CE
168  FormatManager(DSSTemplate* ipTemplate, DSSRWGridIterator* ipIterator);
169  //FormatManager(void* ipGridIterator);
170 #else
171  FormatManager(ICDSSTemplate* ipTemplate, ICDSSRWIterator* ipIterator);
172  FormatManager(ICDSSRWIterator* ipGridIterator);
173 #endif
174  ~FormatManager();
175 
176  //Get Format
177  CComVariant* GetFormat(Int32 iPropertyID); //< this is for property from template & Graph Properties
178  CComVariant* GetFormat(Int32 iPropertyID, Int32 iRowIndex, Int32 iColIndex); //< this is for cell level.(For Grid. caller gets a property)
179  FormatInfo::Ptr GetFormat(Int32 iRowIndex, Int32 iColIndex); //< this is for cell level.(For Grid, caller gets a whole block of properties)
180  FormatInfo::Ptr GetFormat(Int32 iRowIndex, Int32 iColIndex, void* ipFormatInfo); //< this is used to populate an out-sourced formatInfo.
181 #ifndef _VE_CE
182  FormatInfo::Ptr GetFormat(GUID& iGUID, FORMAT_CATEGORY iCellType);
183  FormatInfo::Ptr GetFormat(void* ipGridCell, bool iIsPassToGridCell = false);
184  FormatInfo::Ptr GetMetricFormat(GUID& iGUID,bool iIsHeader, void* ipFormatInfo = NULL); //< Get Format for one metric Header
185 #endif
186  //Get FontName
187  MBase::String CheckFontName(MBase::String& irName); //for graph
188 
189  //Set Inherit Graph Properties
190  void SetUseGraphProperties(bool iIsUseGraphProperties);
191 
192  //Get Graph Property
193  bool GetGraphProperty(Int32 iPropertyId, Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId, CComVariant* opValue);
194  //Get Column Width, for grid, should only be called when it is in fixed mode
195  Int32 GetColumnWidth(Int32 iColumnIndex);
196  Int32 GetRowHeight();
197  //Get Stauts
198  bool IsValid();
199 #ifndef _VE_CE
200  //Get Template
201  DSSTemplate* GetTemplate();
202 
203  //Get Iterator
204  DSSRWGridIterator* GetIterator();
205 #endif
206  //Get Dataset : Dataset should only be used to help to map (row col) to some object key.
207  Dataset::Ptr GetDataset();
208 
209  //Set Dataset
210  void SetDataset(Dataset::Ptr ipDatasetPtr);
211 #ifndef _VE_CE
212 
213  //Mapping the index passed by CE into the data area
214  GRID_AREA MapToDataCellIndex(Int32& orX, Int32& orY, bool iIsPersistent = false);
215 
216  //Get Current Index Passed by CE
217  void GetCurrentIndex(Int32& orRowIndex, Int32& orColIndex);
218 
219  //Get template Metrics Info
220  MetricUnitInfo* GetMetricInfo();
221 
222  //Get TemplateUnit
223  DSSTemplateUnit* GetTemplateUnit(GUID& irID);
224 
225  //Map CurrentIndex to MetricID, needed by templatelayer for subtotal
226  // bool MapToMetricIDForSubtotal(GUID& orID);
227 
228  //Map Row/col to GUID & CellType at one specific layer
229  bool MapToGUIDAndType(GUID& orID, FORMAT_CATEGORY& orCellType, FORMAT_LAYER_INDEX iLayerIndex = FLI_TEMPLATE);
230 
231  //Map Name to Unit Index: need by Banding layer
232  Int32 MapNameToUnitIndex(std::string iName, bool iIsInRow);
233 
234  bool GetConsolidationElementAndCellType(std::vector<DSSConsolidationElement*>& orElement, FORMAT_CATEGORY& orCellType, FORMAT_LAYER_INDEX iLayerIndex);
235 #endif
236  //Set/Get Theme type
237  void SetThemeType(ThemeType iType);
238  ThemeType GetThemeType() const;
239 
240  //Get/Set isGrid
241  EnumFormatRenderType GetRenderType() const;
242  void SetRenderType(EnumFormatRenderType iType);
243 #ifndef _VE_CE
244  //Get single GraphProperty
245  Int32 GetGraphSubType();
246  Int32 GetMaxColumns();
247  Int32 GetMaxRows();
248  Int32 GetHeight();
249  Int32 GetWidth();
250  Int32 GetSeriesCount();
251  bool GetSeriesByColumn();
252  bool GetSubTotalsEnabled();
253 #endif
254  //Variant to Return
256 #ifndef _VE_CE
257  //Get format info ptr
258  FormatInfo::Ptr GetFormatInfo();
259 #endif
260 
261  //Set Graph Properties (with high priority)
262  bool SetMasterGraphProperty(GraphPropertyKey& irKey, CComVariant* ipProperty);
263 
264 #ifndef _VE_CE
265  //CustomGroup
266  bool MaptoCustomGroupElementAndCellType(FORMAT_CATEGORY& orCellType, std::vector<DSSBaseElementProxy*>& orElementVector);
267 
268  //Get Numberformat information For One Cell
269  bool GetChartAdvFormatForOneCell(Int32 iDataCellRowIndex, Int32 iDataCellColIndex, ChartAdvFormat& orChartAdvFormat, bool iConsiderThresholds);
270 
271  //Is NumberFormat Only to retrieve.
272  bool IsNumberFormatExclusive();
273 
274  //Is Subtotal Of Count Style
275  bool SubtotalIsCount();
276 #endif
277  //Set graph type.
278  void SetGraphType(short iGraphType);
279 
280  //Get Span from Tempalte Edge to the data point
281  Int32 DistanceToDataOrigion(bool iIsAlongRow);
282 #ifndef _VE_CE
283  //Cell Level Format
284  bool GetGUIDForCellLevelData(GUID& iorGUID, const void* ipRawData);
285 
286  //Get/Set current GridCell
287  void* GetCurrentGridCell();
288  void SetCurrentGridCell(void* ipCurrentGridCell);
289  const void* GetCurrentCellData();
290 
291  // Has banding or not.
292  bool HasBanding()const;
293 
294  /*
295  * Convert the coordinate used in the CellView (that is row number column number) to
296  * the coordinate used in the Data Mode (that is axis, depth, ordinal) and the cell type
297  * for header
298  * Return true for success convertion, false for failure the the oAxis, oDepth, oOrdinal are meanless, set to -1;
299  */
300  bool CoordinateConvertion(int iRow, int iCol, int& oAxis, int& oDepth, int& oOrdinal, FORMAT_CATEGORY& oCellType);
301  bool GetCoordinateIntoDataArea(int& iorIndex, bool iIsForRow);
302 
303  //Get totoal count of DssFormat
304  Int32 GetDssFormatCount();
305 
306  //Reset layer stack
307  void ResetLayers();
308 
309  //Memory Estimation
314  Int32 GetMemoryUsageEstimation();
315 #endif
316  //Get / Set Properties
317  bool IsShowRowHeader();
318  void SetShowRowHeader(bool iShowRowHeader);
319 
320  bool IsShowColHeader();
321  void SetShowColHeader(bool iShowColHeader);
322 
323  bool IsColHeaderEmpty();
324  bool IsRowHeaderEmpty();
325  bool HasDerivedElementOnRow();
326  bool HasDerivedElementOnCol();
327  bool HasExtraColumn();
328  bool HasCustomGroup();
329  bool HasMetrics();
330  bool HasConsolidationOnRow();
331  bool HasConsolidationOnColumn();
332  bool HasCellLevelFormat();
333  void GetRegularDrillableUnit(std::set<std::pair<Int32, Int32> > &orRegularDrillableUnits);
334  void GetLinkedDrillableUnit(std::set<std::pair<Int32, Int32> > &orLinkedDrillableUnits);
335  Int32 GetAbsColDataGridOrigin();
336  Int32 GetAbsRowDataGridOrigin();
337  void GetRowIndexToUnitIndex(std::map<Int32, Int32> &orRowIndexToUnitIndex);
338  void GetUnitIndexToRowStartOrdinal(std::map<Int32, Int32> &orUnitIndexToRowStartOrdinal);
339  Int32 GetColHeaderStartIndex();
340  Int32 GetColSubtotalMatrixSize();
341  Int32 GetRowSubtotalMatrixSize();
342 #ifndef _VE_CE
343  void AddFormattingLayer(BaseFormatting *ipFormattingLayer);
344  //from private to public for code re-organization
345  void GetLinkedDrillableUnitSet();
346  void GetRegularDrillableUnitSet();
347  MBase::GUID GetMetricIDFromColRowIndex(Int32 iRowIndex, Int32 iColIndex);
348  protected:
349  //Index -> other Info mapping
350  bool hMapIndexToCellTypeAndGUID(Int32 iRowIndex, Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
351  bool hMapIndexToCellTypeAndGUIDWithNoMetric(Int32 iRowIndex, Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
352  //for banding property
353  Int32 hBuildBandingBuckets(Int32 iUnitElementIndex, bool iIsInRow);
354  Int32 hBucketToBandingGroup(Int32 iOrdinal);
355  Int32 hMapUnitIndexToOrdianlOnAxis(Int32 iUnitIndex, bool iIsInRow);
356  bool hMapIndexToBandingGroup(Int32 iRowOrdinal, Int32 iColOrdinal, GUID& iorInfoGUID, FORMAT_CATEGORY& orCellType);
357  //bading
358  //custom group
359  bool hIsBaseElementLegal(DSSBaseElementProxy* ipBaseElementProxy);
360  bool hIsInEmptyZone(Int32 iRowIndex, Int32 iColIndex);
361  void hGetSubtotalMatrix(bool iIsForRow, SubTotalMap& orSubtotalMatrix);
362 
367  void hGetIndexMap(bool iIsForRow);
368 
369  void hCheckLayerSignals(bool iIsForRow);
370 
378  Int32 hGetUnitStep(DSSTemplateUnit* ipUnit, Int32 iAxisId, Int32 iUnitIndex);
379 
380  MBase::GUID hGetUnitIDFromColRowIndex(Int32 iIndex, bool iIsForRow);
381 
382  bool hParseSpecialColumn(Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
383  bool hParseRowSection(Int32 iRowIndex, Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
384  bool hParseColSection(Int32 iRowIndex, Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
385  bool hParseDataArea(Int32 iRowIndex, Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
386  bool hParseEmptyZone(Int32 iRowIndex, Int32 iColIndex, FORMAT_CATEGORY& orCellType, GUID& orID);
387 
388  bool hGetConsolidationElementFromRow(Int32 iRowIndex, Int32 iColIndex, std::vector<DSSConsolidationElement*>& orElement, FORMAT_CATEGORY& orCellType);
389  bool hGetConsolidationElementFromColumn(Int32 iRowIndex, Int32 iColIndex, std::vector<DSSConsolidationElement*>& orElement, FORMAT_CATEGORY& orCellType);
390  bool hGetConsolidationElementFromDataArea(Int32 iRowIndex, Int32 iColIndex, std::vector<DSSConsolidationElement*>& orElement, FORMAT_CATEGORY& orCellType);
391 #endif
392 
393  //Set ExtraColumn
394  bool hSetExtraCloumnFlag();
395  //Calculate Origin
396  void hSetDataGridOrigin();
397 
398  protected:
400 
401  private:
402  void hDumpTotalNumberFormat(); //this is for [testing].
403 
404  private:
405 #ifdef _VE_CE
406  void hInit(ICDSSTemplate* ipTemplate, ICDSSRWIterator* ipIterator); //init formatmanger
407 #else
408  void hInit(DSSTemplate* ipTemplate, DSSRWGridIterator* ipIterator); //init formatmanger
409  void hInitLayers(GUID& irID, FORMAT_CATEGORY& irCellType); //Init formatting for each layer
410  void hRegisterOneLayer(FORMAT_LAYER_INDEX iLayerIndex, GUID& irID, FORMAT_CATEGORY& irCellType); //Push one layer into the layer stack.
411 #endif
412  void hClearLayers();
413 
414  void hMapByProperty(Int32& iSeriesId, Int32& iObjectId, Int32& iPropertyId);
415  void hConvertFromRGBtoBGR(Int32& inVal);
416  void hSetDrillable(void* ipGridCell, FormatInfo::Ptr iFormatPtr);
417 #ifndef _VE_CE
418  bool hHasLinkedDrill(DSSTemplateUnit* ipTemplatUnit);
419 #endif
420 
421  Int32 hGetAxisAutoFitProperty(Int32 inObjectId);
422  Int32 hGetAxisVisibilityProperty(Int32 inObjectId);
423  Int32 hGetAxisZeroProperty(Int32 inObjectId);
424  Int32 hGetAxisScaleProperty(Int32 inObjectId);
425  Int32 hGetAxisLogProperty(Int32 inObjectId);
426  Int32 hGetAxisGridLineProperty(Int32 inObjectId);
427  Int32 hGetAxisGridLineProperty2(Int32 inObjectId);
428  Int32 hGetAxisScaleEndProperty(Int32 inObjectId);
429  Int32 hGetAxisAdvFormatTextProperty(Int32 inObjectId);
430  Int32 hGetAxisDirectionProperty(Int32 inObjectId);
431  Int32 hGetAxisCustomLine(Int32 inObjectId);
432  Int32 hGetAxisOffScaleProperty(Int32 inObjectId);
433  Int32 hGetAxisLabelLocationProperty(Int32 inObjectId);
434  Int32 hGetAxisStaggerProperty(Int32 inObjectId);
435  Int32 hGetAxisScaleFreqProperty(Int32 inObjectId);
436 
437  void hMapWebGraphTypeToAgent(Int32 iMajorType, Int32 iMinorType, Int32 &oType);
438 
439  private:
440  Dataset* mpDataset; //global dataset
441  Dataset* mpSlicedDataset; //sliced one by setting group by unit.
442 #ifdef _VE_CE
443  ICDSSTemplate* mpTemplate;
444  ICDSSRWIterator* mpIterator;
445  ICDSSGraphStyle* mpGraphStyle;
446 #else
447  DSSTemplate* mpTemplate;
448  DSSRWGridIterator* mpIterator;
449 #endif
450 
451  FormatManagerHelper* mpFormatManagerHelper;
452  bool mHasExtraColumn; //Special handling.
453  bool mIsValid;
454  bool mIsRowHeaderEmpty;
455  bool mIsColHeaderEmpty;
456  bool mHasMetrics;
457  bool mIsShowRowHeader;
458  bool mIsShowColHeader;
459  bool mIsLayersInited;
460  bool mIsNumberformatExclusive; //< used only in graph axis formatting.
461  bool mParseThresholds; //< This is used when parsing graph axis auto format.
462  bool mAbsoluteCoordinates; //< Whether or not the pass-in row/col index is already absolute coordinates that have taken hidden headers into consideration.
463 
464  //For Layers initialization
465  bool mHasCustomGroup;
466  bool mHasConsolidationOnRow;
467  bool mHasConsolidationOnColumn;
468  bool mHasDerivedElementOnRow;
469  bool mHasDerivedElementOnCol;
470 
471  bool mHasCellLevelFormat; //Cell Level Format
472  void* mpCurrentGridCell;
473  const void* mpCurrentCellData;
474  ThemeType mThemeType;
475  Int32 mRowHeaderStartIndex; //along row
476  Int32 mColHeaderStartIndex; //along column
477 
478  Int32 mRowHeaderWidth; //span on column
479  Int32 mColHeaderHeight; //span on row
480 
481  Int32 mCurrentRowIndex;
482  Int32 mCurrentColIndex;
483 
484  Int32 mRowDataGridOrigin; //real index in real template of data (0,0)
485  Int32 mColDataGridOrigin;
486 
487  Int32 mAbsRowDataGridOrigin; //index of data(0, 0) into complete tempalte.
488  Int32 mAbsColDataGridOrigin;
489 
490  Int32 mDssFormatTotal; //Total Number of DssFormat object defined in modal.
491 
492  std::map<Int32, Int32> mRowIndexToUnitIndex; //Grid Row Header's index --> templateUnitIndex.
493  std::map<Int32, Int32> mColIndexToUnitIndex; //Grid Col Header's index --> tempalteUnitIndex.
494 
495  std::map<Int32, Int32> mRowIndexToRowDepthIndex; //Grid Row Header's index --> depthIndex, to call lawrence's API
496  std::map<Int32, Int32> mColIndexToColDepthIndex; //Grid Col Header's index --> depthIndex, to call lawrence's API
497 
498  std::map<Int32, GUID> mRowUnitIndexToID; //Grid templateUnitIndex --> templateUnit ID
499  std::map<Int32, GUID> mColUnitIndexToID;
500 
501  std::map<Int32, Int32> mUnitIndexToRowStartOrdinal; //unit index --> start ordinal for this unit
502  std::map<Int32, Int32> mUnitIndexToColStartOrdinal;
503 
504  std::map<Int32, GUID> mOrdinalToMetricID;//Absolute oridianl ==> Metric Id
505 #ifndef _VE_CE
506  std::map<GUID, DSSTemplateUnit*> mIDToUnit; //GUID -> templateUnit.
507 #endif
508 
509  GraphPropertyKeyMap mMasterGraphPropertyPool;
510 
511  std::vector<Int32> mBandingBuckets; //to cache the banding range for group1/group2 [a1, a2, a3] ==>[a1, a2) is in G1 [a2 a3) is in G2.
512 
513  Int32 mUniformElementsSpan; //if all the elements takes euqal span in "by unit" case of banding, this value will be meaningful, otherwise -1.
514 
515  SubTotalMap mRowSubtotalMatrix; //RowIndex -> UnitDepth
516  SubTotalMap mColSubtotalMatrix; //ColIndex -> UnitDepth.
517 
518  std::map<Int32, EnumDSSMetricType> mRowOrdianlToSubtotalType; //Row data ordinal to subtotal type
519  std::map<Int32, EnumDSSMetricType> mColOrdianlToSubtotalType; //Col data ordinal to subtotal type
520 
521  std::set<Int32> mDrillableColumns;
522 
523  std::vector<BaseFormatting*> mFormattingLayers;
524 
525  GUID mAssociatedGUID; //< the Key to maps, under currenct subtotal pool.
526 
527  MetricUnitInfo* mpInfo; //< metric information
528  std::map<std::string, int> mAxisInfoMap[2];//< unit name to index
529 #ifndef _VE_CE
530  CustomGroupUnitInfo* mpCustomGroupInfo; //custom group infomation
531 
532  DSSGraphProperties* mpGraphPropertyPool; //< grpah properties
533 
534  FORMAT_LAYER_INDEX mLayerToParse; //< at which layer we are resolving/merging/caching.
535 #endif
536 
537  Int32 mGraphType;
538 
539  std::string mKey; //for debugging.
540 
541  EnumFormatRenderType mRenderType;
542 
543  bool mIsUseGraphProperties;
544 
545  GRID_AREA mCurrentCellPosition;
546 #ifndef _VE_CE
547  std::vector<std::pair<DSSBaseElementProxy*, Int32> > mAssociatedCGElementSetOnCol;
548  std::vector<std::pair<DSSBaseElementProxy*, Int32> > mAssociatedCGElementSetOnRow;
549  std::vector<std::pair<DSSConsolidationElement*, Int32> > mAssociatedConsolElementSetOnRow;
550  std::vector<std::pair<DSSConsolidationElement*, Int32> > mAssociatedConsolElementSetOnCol;
551 #endif
552  std::set<std::pair<Int32, Int32> > mRegularDrillableUnits; //store the units that support regular drill
553  std::set<std::pair<Int32, Int32> > mLinkedDrillableUnits; //store the units that support linked drill
554  bool mIsLinkedDrillableUnitSetReady;
555  bool mIsRegularDrillableUnitSetReady;
556  public:
557 #ifndef _VE_CE
558  //cell level formatting.
559  bool GetConsolidationStatus(bool iIsOnRow);
560  CustomGroupUnitInfo* GetCGInfo();
561  GRID_AREA GetCurrentCellPosition();
562  std::vector<std::pair<DSSConsolidationElement*, Int32> >* GetAssociateConsolidationElementSet(bool iIsForRow);
563  std::vector<std::pair<DSSBaseElementProxy*, Int32> >* GetAssociateCustomGroupElementSet(bool iIsForRow);
564 #endif
565  };
566 
567  //Set Graph Type
568  inline void FormatManager::SetGraphType(short iGraphType)
569  {
570  mGraphType = iGraphType;
571  }
572 
573 #ifndef _VE_CE
574  //Get Current Raw data -- cell format
576  {
577  return mpCurrentCellData;
578  }
579 
580  //Get Current cell -- cell format
582  {
583  return mpCurrentGridCell;
584  }
585  inline void FormatManager::SetCurrentGridCell(void* ipCurrentGridCell)
586  {
587  mpCurrentGridCell = ipCurrentGridCell;
588  }
589 #endif
590  //Get Stauts
592  {
593  return mIsValid;
594  }
595 #ifndef _VE_CE
596  //Get Template
598  {
599  return mpTemplate;
600  }
601 
602  //Get Iterator
604  {
605  return mpIterator;
606  }
607 
608  //Get dataset [to delete]
610  {
611  return mpDataset;
612  }
613 
614  //Set sliced dataset
615  inline void FormatManager::SetDataset(Dataset::Ptr ipDatasetPtr)
616  {
617  mpDataset = ipDatasetPtr;
618  }
619 
620  //Get current input index.
621  inline void FormatManager::GetCurrentIndex(Int32& orRowIndex, Int32& orColIndex)
622  {
623  orRowIndex = mCurrentRowIndex;
624  orColIndex = mCurrentColIndex;
625  }
626 
627  //Get metric related info
629  {
630  if (mpInfo && mpInfo->mIsValid)
631  return mpInfo;
632  else
633  return NULL;
634  }
635 
636  //Get the total number of DssFormat.
638  {
639  return mDssFormatTotal;
640  }
641 #endif
642  //Get / Set theme
644  {
645  mThemeType = iType;
646  }
647 
649  {
650  return mThemeType;
651  }
652 
653  //Is used for grid formatting.
655  {
656  mRenderType = iType;
657  }
658 
660  {
661  return mRenderType;
662  }
663 
664 #ifndef _VE_CE
666 #endif
667 
669  {
670  return mIsShowRowHeader;
671  }
672  inline void FormatManager::SetShowRowHeader(bool iShowRowHeader)
673  {
674  mIsShowRowHeader = iShowRowHeader;
675  }
677  {
678  return mIsShowColHeader;
679  }
680  inline void FormatManager::SetShowColHeader(bool iShowColHeader)
681  {
682  mIsShowColHeader = iShowColHeader;
683  }
685  {
686  return mIsColHeaderEmpty;
687  }
689  {
690  return mIsRowHeaderEmpty;
691  }
693  {
694  return mHasExtraColumn;
695  }
696  inline void FormatManager::GetRegularDrillableUnit(std::set<std::pair<Int32, Int32> > &orRegularDrillableUnits)
697  {
698  orRegularDrillableUnits = mRegularDrillableUnits;
699  }
700  inline void FormatManager::GetLinkedDrillableUnit(std::set<std::pair<Int32, Int32> > &orLinkedDrillableUnits)
701  {
702  orLinkedDrillableUnits = mLinkedDrillableUnits;
703  }
705  {
706  return mAbsColDataGridOrigin;
707  }
709  {
710  return mAbsRowDataGridOrigin;
711  }
713  {
714  return mHasMetrics;
715  }
716  inline void FormatManager::GetRowIndexToUnitIndex(std::map<Int32, Int32> &orRowIndexToUnitIndex)
717  {
718  orRowIndexToUnitIndex = mRowIndexToUnitIndex;
719  }
720  inline void FormatManager::GetUnitIndexToRowStartOrdinal(std::map<Int32, Int32> &orUnitIndexToRowStartOrdinal)
721  {
722  orUnitIndexToRowStartOrdinal = mUnitIndexToRowStartOrdinal;
723  }
725  {
726  return mColHeaderStartIndex;
727  }
728 
730  {
731  return (Int32)mColSubtotalMatrix.size();
732  }
734  {
735  return (Int32)mRowSubtotalMatrix.size();
736  }
738  {
739  return mHasDerivedElementOnRow;
740  }
742  {
743  return mHasDerivedElementOnCol;
744  }
746  {
747  return mHasCustomGroup;
748  }
750  {
751  return mHasConsolidationOnRow;
752  }
754  {
755  return mHasConsolidationOnColumn;
756  }
758  {
759  return mHasCellLevelFormat;
760  }
761 #ifndef _VE_CE
762  inline void FormatManager::AddFormattingLayer(BaseFormatting *ipFormattingLayer)
763  {
764  if (ipFormattingLayer != NULL) {
765  mFormattingLayers.push_back(ipFormattingLayer);
766  }
767  }
768 #endif
769 }
770 
771 #endif
772 
Definition: FormatManager.h:52
void * GetCurrentGridCell()
Definition: FormatManager.h:581
std::map< GraphPropertyKey, CComVariant, KeyCompare > GraphPropertyKeyMap
Definition: FormatManager.h:164
Definition: DSSIPhoneEnums.h:2490
static CComVariant sVariant
Definition: FormatManager.h:255
void SetThemeType(ThemeType iType)
Definition: FormatManager.h:643
Definition: DSSIPhoneEnums.h:2530
Definition: FormatManager.h:66
DSSRWGridIterator * GetIterator()
Definition: FormatManager.h:603
FORMAT_LAYER_INDEX
Definition: FormatManagerHelper.h:28
Int32 GetColHeaderStartIndex()
Definition: FormatManager.h:724
Definition: GridFormatting.h:29
bool mIsValid
Definition: DatasetHelper.h:480
Definition: DSSGraphProperties.h:20
Int32 mObjectId
Definition: FormatManager.h:104
bool operator==(GraphPropertyKey &lRight)
Definition: FormatManager.h:117
Definition: FormatManager.h:65
Definition: FormatManager.h:56
Definition: DSSIPhoneEnums.h:2543
Definition: DSSBaseElementProxy.h:16
bool IsColHeaderEmpty()
Definition: FormatManager.h:684
void SetCurrentGridCell(void *ipCurrentGridCell)
Definition: FormatManager.h:585
Definition: DSSIPhoneEnums.h:2494
Definition: FormatManager.h:55
Definition: FormatManager.h:53
Definition: DSSIPhoneEnums.h:2513
Definition: FormatManager.h:39
Definition: DSSIPhoneEnums.h:2434
void SetDataset(Dataset::Ptr ipDatasetPtr)
Definition: FormatManager.h:615
GraphPropertyKey(Int32 iPropertyId, Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId)
Definition: FormatManager.h:108
bool IsRowHeaderEmpty()
Definition: FormatManager.h:688
Definition: Base/Base/GUID.h:365
This struct is from ChartCtrl.h.
Definition: NumberObject.h:38
Definition: FormatManager.h:134
void GetUnitIndexToRowStartOrdinal(std::map< Int32, Int32 > &orUnitIndexToRowStartOrdinal)
Definition: FormatManager.h:720
Definition: DSSIPhoneEnums.h:2488
Definition: DSSTemplateUnit.h:19
FormatInfo::Ptr mFormatInfoPtr
Definition: FormatManager.h:399
Int32 GetAbsRowDataGridOrigin()
Definition: FormatManager.h:708
#define CHARTENGINE_API
Definition: Dataset.h:22
Definition: DSSRWGridIterator.h:68
CHARTENGINE_API FormatManager::Ptr CreateFormatManager(DSSRWGridIterator *ipIterator)
Definition: DatasetHelper.h:573
Definition: DSSTemplate.h:29
MetricUnitInfo * GetMetricInfo()
Definition: FormatManager.h:628
void SetShowColHeader(bool iShowColHeader)
Definition: FormatManager.h:680
FormatManager * Ptr
Definition: FormatManager.h:161
const void * GetCurrentCellData()
Definition: FormatManager.h:575
Definition: Dataset.h:198
GraphPropertyKey(Int32 iPropertyId, TripleId &iTripleId)
Definition: FormatManager.h:112
Definition: FormatManager.h:41
Definition: DSSIPhoneEnums.h:2522
EnumFormatRenderType
Definition: FormatManager.h:62
bool HasMetrics()
Definition: FormatManager.h:712
void GetRegularDrillableUnit(std::set< std::pair< Int32, Int32 > > &orRegularDrillableUnits)
Definition: FormatManager.h:696
Definition: DSSIPhoneEnums.h:2496
Definition: DSSIPhoneEnums.h:2511
#define Int32
Definition: BasicTypes.h:20
Int32 GetRowSubtotalMatrixSize()
Definition: FormatManager.h:733
Definition: FormatManager.h:47
Definition: DSSIPhoneEnums.h:2507
bool HasExtraColumn()
Definition: FormatManager.h:692
bool HasCustomGroup()
Definition: FormatManager.h:745
Definition: Enums.h:664
Definition: FormatManager.h:45
Definition: FormatManager.h:42
Definition: FormatManager.h:101
Definition: FormatManager.h:64
Definition: FormatManager.h:44
void GetCurrentIndex(Int32 &orRowIndex, Int32 &orColIndex)
Definition: FormatManager.h:621
Int32 mSeriesId
Definition: FormatManager.h:105
Definition: DSSIPhoneEnums.h:2455
Definition: FormatManagerHelper.h:46
Definition: FormatManager.h:43
Definition: DSSIPhoneEnums.h:2516
std::map< Int32, Int32 > SubTotalMap
Definition: FormatManager.h:163
Definition: FormatManagerHelper.h:31
Dataset::Ptr GetDataset()
Definition: FormatManager.h:609
bool IsValid()
Definition: FormatManager.h:591
bool IsShowColHeader()
Definition: FormatManager.h:676
Definition: Enums.h:663
Int32 mPropertyId
Definition: FormatManager.h:103
Definition: FormatManager.h:63
std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > String
Definition: BaseString.h:26
Int32 mGroupId
Definition: FormatManager.h:106
Definition: ABLPlot.h:21
Definition: DSSIPhoneEnums.h:2448
void SetRenderType(EnumFormatRenderType iType)
Definition: FormatManager.h:654
Definition: DSSIPhoneEnums.h:2532
GRID_AREA
Definition: FormatManager.h:36
EnumFormatRenderType GetRenderType() const
Definition: FormatManager.h:659
Definition: DSSIPhoneEnums.h:2484
Definition: DSSIPhoneEnums.h:2504
bool IsShowRowHeader()
Definition: FormatManager.h:668
Definition: FormatManager.h:40
bool HasDerivedElementOnRow()
Definition: FormatManager.h:737
Definition: DSSIPhoneEnums.h:2519
Definition: DSSIPhoneEnums.h:2441
EnumAxisShowProperty
Definition: FormatManager.h:50
bool HasConsolidationOnRow()
Definition: FormatManager.h:749
Definition: Msi_ccomvariant.h:24
Definition: FormatManager.h:58
void AddFormattingLayer(BaseFormatting *ipFormattingLayer)
Definition: FormatManager.h:762
void GetRowIndexToUnitIndex(std::map< Int32, Int32 > &orRowIndexToUnitIndex)
Definition: FormatManager.h:716
bool HasDerivedElementOnCol()
Definition: FormatManager.h:741
bool BelongTo(GraphPropertyKey &lRight) const
Definition: FormatManager.h:126
Definition: DSSIPhoneEnums.h:2476
Int32 GetAbsColDataGridOrigin()
Definition: FormatManager.h:704
Definition: DatasetHelper.h:490
_ThemeType
Definition: Enums.h:660
Definition: FormatManager.h:38
bool HasCellLevelFormat()
Definition: FormatManager.h:757
enum _ThemeType ThemeType
Int32 GetColSubtotalMatrixSize()
Definition: FormatManager.h:729
#define NULL
Definition: Null.h:10
Definition: FormatManager.h:54
void SetGraphType(short iGraphType)
Definition: FormatManager.h:568
Definition: DSSIPhoneEnums.h:2497
bool operator()(const GraphPropertyKey &lLeft, const GraphPropertyKey &lRight) const
Definition: FormatManager.h:136
void GetLinkedDrillableUnit(std::set< std::pair< Int32, Int32 > > &orLinkedDrillableUnits)
Definition: FormatManager.h:700
ThemeType GetThemeType() const
Definition: FormatManager.h:648
Definition: FormatManager.h:57
Definition: DSSIPhoneEnums.h:2529
Definition: FormatManager.h:46
Definition: DSSIPhoneEnums.h:2462
Definition: DSSIPhoneEnums.h:2528
Definition: Base/Base/GUID.h:32
bool HasConsolidationOnColumn()
Definition: FormatManager.h:753
Int32 GetDssFormatCount()
Definition: FormatManager.h:637
void SetShowRowHeader(bool iShowRowHeader)
Definition: FormatManager.h:672
DSSTemplate * GetTemplate()
Definition: FormatManager.h:597
Definition: FormatInfo.h:60
Definition: Common.h:397
Definition: DSSIPhoneEnums.h:2469
Definition: FormatManager.h:157
Definition: Enums.h:662
FORMAT_CATEGORY
Definition: FormatManagerHelper.h:9