Mobile API Reference  MicroStrategy 2019
CellFmtData.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : CellFmtData.h
3 // AUTHOR : Zhongchao Yu
4 // CREATION : 09/22/2005
5 // Copyright (C) MicroStrategy, Inc. 2005
6 //==============================================================================================
7 #ifndef MDataType_CellFmtData_h
8 #define MDataType_CellFmtData_h
9 
10 #include "Base/Base/GUID.h"
11 #include "Base/Base/String.h"
12 #include "Base/Base/ReturnString.h"
13 #include "Base/Base/Language.h"
14 
17 #include "PDCHeader/PDCmap"
18 
19 
20 namespace MDataType
21 {
23  {
24  public:
25  CellFmtStruct();
26  ~CellFmtStruct() throw();
27 
28  bool operator == (const CellFmtStruct& iCellFmtStruct) const;
29 
31  MBase::String mFormatString; // Store a format string as specified in Cell Level Formatting document
32  long mBackColor; // Background color
33  long mForeColor; // Color in which cell value is displayed
34 
35  // Only SAP
36  // MWKZ field in CellData table
37  // amount 'W',
38  // quantity 'M',
39  // price 'P',
40  // ratio 'Q',
41  // percent '%',
42  // counter 'C',
43  // float 'F',
44  // date 'D',
45  // time 'T',
46  // else 'S',
47  // mixed_dim '*', // Only 2004s
48  // char 'A',
49  // inactive 'I',
50  MBase::String mMWKZ; // MWKZ field for the cell
51 
52  short mPosition; //0: Left, 1: Right, 2: Left-space, 3:Right-space
53  MBase::String mCurrency; // Currency
54 
55  bool bFlipSign;
56  short mScalingFactor; // 0 for no scaling, 1 for 10's, 2 for 100's, 3 for 1000's
57  short mPrecision; // Number of digits after decimal place
58 
59  //Only MSAS
60  MBase::String mFontName; // Font name
61  short mFontSize; // Font size
63  };
64 
66 
67  //==============================================================================================
68  // CellFmtData is a concrete class represent the Cell Formatting Data. Besides values, it
69  // also contains types and format objects.
70 
71  // Operations on CellFmtData assume "return by value" as opposed to the "return by pointer"
72  // in the favor of simplicity. All compilers but CC on Solaris support "Named Return Value
73  // Return Value Optimization" by default. Thus the overhead is mitigated.
74  //==============================================================================================
75 
77  {
78  public:
79  // Constructors
80  CellFmtData(); // default constructor
81  CellFmtData(double iDouble, EnumCellFmtDataTypes iType, const GUID& iFmtID);
82 
83  // Copy constructor (for NRVO)
84  CellFmtData(const CellFmtData& iCellFmtData);
85 
86  // Getters
87  double GetValue() const;
88  CellFmtStructPtr GetCellFmtStructPtr() const;
89  EnumCellFmtDataTypes GetType() const;
90  GUID GetFmtID() const;
91 
92  // Setters
93  void PutValue(double iDouble);
94  void PutCellFmtStructPtr(CellFmtStructPtr iPtr);
95  void PutType(EnumCellFmtDataTypes iType);
96  void PutFmtID(const GUID& iFmtID);
97 
98  bool operator==(const CellFmtData& iCellFmtData) const;
99 
100  // The following is only useful for ordering purpose.
101  bool operator<(const CellFmtData& iCellFmtData) const;
102 
103  // For serialization
104  // Caller is responsible to allocate memory for ipBuffer
105  Int32 SaveObj(unsigned Int32 inSize, void* ipBuffer, Int32 mode) const;
106  Int32 LoadObj(unsigned Int32 inSize, void* ipBuffer);
107 
108  private:
109 
110  double mValue;
111  CellFmtStructPtr mCellFmtStructPtr;
112  EnumCellFmtDataTypes mType;
113  GUID mFmtID;
114  };
115 
116 } // MDataType
117 #endif // MDataType_CellFmtData_h
bool operator<(const ::GUID &irGUID1, const ::GUID &irGUID2)
Definition: Base/Base/GUID.h:156
unsigned short LanguageID
Definition: Language.h:27
MBase::String mFontName
Definition: CellFmtData.h:60
MBase::LanguageID mLanguageID
Definition: CellFmtData.h:62
short mPrecision
Definition: CellFmtData.h:57
MBase::String mFormatString
Definition: CellFmtData.h:31
bool operator==(const Allocator< _Ty > &left, const Allocator< _UT > &right)
Definition: Allocator.h:204
long mForeColor
Definition: CellFmtData.h:33
#define DLL_DATATYPE_EXIM
Definition: DataType.h:22
short mFontSize
Definition: CellFmtData.h:61
Definition: BigDecimal.h:18
short mScalingFactor
Definition: CellFmtData.h:56
MBase::String mCurrency
Definition: CellFmtData.h:53
bool bFlipSign
Definition: CellFmtData.h:55
Definition: CellFmtData.h:22
EnumCellFmtNumberCategory
Definition: CellFmtDataTypes.h:53
#define Int32
Definition: BasicTypes.h:20
EnumCellFmtDataTypes
Definition: CellFmtDataTypes.h:31
CellFmtStruct * CellFmtStructPtr
Definition: CellFmtData.h:65
std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > String
Definition: BaseString.h:26
Definition: CellFmtData.h:76
short mPosition
Definition: CellFmtData.h:52
long mBackColor
Definition: CellFmtData.h:32
EnumCellFmtNumberCategory mCategory
Definition: CellFmtData.h:30
MBase::String mMWKZ
Definition: CellFmtData.h:50
Definition: Base/Base/GUID.h:32