00001
00048 #ifndef INC_RVC_LEGEND_H
00049 #define INC_RVC_LEGEND_H
00050
00051 #ifndef INC_RVC_OBJECT_H
00052 #include <rvc/object.h>
00053 #endif
00054
00055 #ifndef INC_MI32_ELEMSTYL_H
00056 #include <mi32/elemstyl.h>
00057 #endif
00058
00059 #ifndef INC_RVC_GETOBJFILTER_H
00060 #include <rvc/getobjfilter.h>
00061 #endif
00062
00063
00064 #ifndef GENERATING_DOXYGEN_OUTPUT
00065
00066 namespace RVC {
00067 class LEGENDHANDLE;
00068 struct LEGENDINFO;
00069 struct LEGENDTEXTSTYLE;
00070 }
00071 #endif
00072
00073
00074 namespace RVC {
00075
00081 class LEGEND : public RVC::OBJECT {
00082 public:
00083 #ifndef GENERATING_DOXYGEN_OUTPUT
00084 class GETOBJFILTER_ISSELECTABLE;
00085 class LINE;
00086 class MAKEPARMS;
00087 #endif // GENERATING_DOXYGEN_OUTPUT
00088
00090 LEGEND (
00091 );
00092
00094 LEGEND (
00095 const RVC::LEGEND& rhs
00096 );
00097
00099 virtual ~LEGEND (
00100 );
00101
00103 RVC::LEGEND& operator= (
00104 const RVC::LEGEND& rhs
00105 );
00106
00107 ERRVALUE Clear (
00108 );
00109
00110 ERRVALUE GetMakeParms (
00111 MAKEPARMS& MakeParms
00112 ) const;
00113
00114 INT32 GetNumItems (
00115 ) const;
00116
00117 ERRVALUE Make (
00118 const RVC::OBJECT& parent,
00119 const DESCRIPTOR& Descriptor,
00120 const MAKEPARMS& MakeParms,
00121 const CREDENTIALS* Credentials = 0
00122 );
00123
00124 ERRVALUE Make (
00125 RVC::OBJITEM& ObjItem,
00126 const MAKEPARMS& MakeParms,
00127 const char* Source = 0,
00128 const CREDENTIALS* Credentials = 0
00129 );
00130
00131 ERRVALUE Read (
00132 MISTRING& StyleObjectPath,
00133 FILEPATH& StyleFilePath,
00134 MISTRING& DftQuery,
00135 MISTRING& ContabObjectPath
00136 ) const;
00137
00138 ERRVALUE Read (
00139 INT32 LegendNum,
00140 LINE& LegendLine
00141 ) const;
00142
00143 ERRVALUE Read (
00144 INT32 LegendNum,
00145 MISTRING& string
00146 ) const;
00147
00148 ERRVALUE SetMakeParms (
00149 const MAKEPARMS& MakeParms
00150 );
00151
00152 ERRVALUE Write (
00153 const MISTRING& StyleObjectPath,
00154 const FILEPATH& StyleFilePath,
00155 const MISTRING& DftQuery,
00156 const MISTRING& ContabObjectPath
00157 );
00158
00159 ERRVALUE Write (
00160 INT32 LegendNum,
00161 const LINE& LegendLine
00162 );
00163
00164 ERRVALUE Write (
00165 INT32 LegendNum,
00166 const MISTRING& string
00167 );
00168
00169 private:
00170 #ifndef GENERATING_DOXYGEN_OUTPUT
00171
00173 virtual ERRVALUE v_CloseObject ();
00174 virtual OBJTYPE v_GetDftObjectType () const;
00175 virtual bool v_IsObjectOpen () const;
00176 virtual ERRVALUE v_OpenObject (OPENMODE OpenFlags, MDLGPARENT parent, const CREDENTIALS* Credentials);
00177
00178 static void AssignStyle (const TEXTSTYLE& TextStyle, LEGENDTEXTSTYLE& style);
00179 static void AssignStyle (const LEGENDTEXTSTYLE& style, TEXTSTYLE& TextStyle);
00180 static void SetMakeParms (const LEGENDINFO& LegendInfo, MAKEPARMS& MakeParms);
00181 static void SetMakeParms (const MAKEPARMS& MakeParms, LEGENDINFO& LegendInfo);
00182
00183 LEGENDHANDLE* m_LegendHandle;
00184 mutable SIMPLE_ARRAY<MIUNICODE> m_Buffer;
00185 #endif // GENERATING_DOXYGEN_OUTPUT
00186 };
00187
00188
00189 class LEGEND::GETOBJFILTER_ISSELECTABLE : public GETOBJFILTER {
00190 public:
00191 GETOBJFILTER_ISSELECTABLE ();
00192 private:
00193 #ifndef GENERATING_DOXYGEN_OUTPUT
00194 virtual bool v_HasSelectableSubObjects (const RVC::OBJITEM& objitem);
00195 virtual bool v_IsSelectable (const RVC::OBJITEM& ObjItem, int position);
00196 #endif // GENERATING_DOXYGEN_OUTPUT
00197 };
00198
00199
00200 class LEGEND::LINE {
00201 public:
00202 enum FLAGS {
00203 FLAG_None = 0x00,
00204 FLAG_Selected = 0x01,
00205 FLAG_DescFromField = 0x02,
00206 FLAG_DescQuery = 0x04,
00207 FLAG_DescDQuery = 0x08,
00208 FLAG_DescFromTheme = 0x10,
00209 FLAG_TempUnselected = 0x8000
00210 };
00211
00212 LINE (
00213 );
00214
00215 LINE (
00216 const LINE& rhs
00217 );
00218
00219 ~LINE (
00220 );
00221
00222 LINE& operator=(
00223 const LINE& rhs
00224 );
00225
00226 void Clear (
00227 );
00228
00229 const MISTRING& GetLegendDesc (
00230 ) const { return (m_Desc); }
00231
00232 FLAGS GetLegendFlags (
00233 ) const { return (m_Flags); }
00234
00235 const MISTRING& GetLegendHeading (
00236 ) const { return (m_Heading); }
00237
00238 const MISTRING& GetLegendStyle (
00239 ) const { return (m_Style); }
00240
00241 UINT16 GetLegendType (
00242 ) const { return (m_Type); }
00243
00244 void SetLegendDesc (
00245 const MISTRING& Desc
00246 ) { m_Desc = Desc; }
00247
00248 void SetLegendFlags (
00249 FLAGS flags
00250 ) { m_Flags = flags; }
00251
00252 void SetLegendHeading (
00253 const MISTRING& Heading
00254 ) { m_Heading = Heading; }
00255
00256 void SetLegendStyle (
00257 const MISTRING& Style
00258 ) { m_Style = Style; }
00259
00260 void SetLegendType (
00261 UINT16 type
00262 ) { m_Type = type; }
00263
00264 private:
00265 #ifndef GENERATING_DOXYGEN_OUTPUT
00266 UINT16 m_Type;
00267 FLAGS m_Flags;
00268 MISTRING m_Style;
00269 MISTRING m_Heading;
00270 MISTRING m_Desc;
00271
00272 friend class LEGEND;
00273 #endif // GENERATING_DOXYGEN_OUTPUT
00274 };
00275
00276
00277 class LEGEND::MAKEPARMS {
00278 public:
00279 MAKEPARMS (
00280 );
00281
00282 ~MAKEPARMS (
00283 );
00284
00285 void Clear (
00286 );
00287
00288 const COLOR& GetBackgroundColor (
00289 ) const { return (m_BackgroundColor); }
00290
00291 double GetColSpace (
00292 ) const { return (m_ColSpace); }
00293
00294 double GetColWidth (
00295 ) const { return (m_ColWidth); }
00296
00297 INT32 GetContrastType (
00298 ) const { return (m_ContrastType); }
00299
00300 UINT32 GetDispFlags (
00301 ) const { return (m_DispFlags); }
00302
00303 UINT16 GetElementType (
00304 ) const { return (m_ElementType); }
00305
00306 const COLOR& GetLegendBorderColor (
00307 ) const { return (m_LegendBorderColor); }
00308
00309 double GetLegendBorderWidth (
00310 ) const { return (m_LegendBorderWidth); }
00311
00312 double GetLineSpace (
00313 ) const { return (m_LineSpace); }
00314
00315 double GetMapScale (
00316 ) const { return (m_MapScale); }
00317
00318 double GetMarginWidth (
00319 ) const { return (m_MarginWidth); }
00320
00321 double GetMaxIndex (
00322 ) const { return (m_MaxIndex); }
00323
00324 double GetMinIndex (
00325 ) const { return (m_MinIndex); }
00326
00327 double GetMaxL (
00328 ) const { return (m_MaxL); }
00329
00330 double GetMaxR (
00331 ) const { return (m_MaxR); }
00332
00333 double GetMinL (
00334 ) const { return (m_MinL); }
00335
00336 double GetMinR (
00337 ) const { return (m_MinR); }
00338
00339 UINT32 GetNumCols (
00340 ) const { return (m_numcols); }
00341
00342 UINT32 GetNumTicksL (
00343 ) const { return (m_NumTicksL); }
00344
00345 UINT32 GetNumTicksR (
00346 ) const { return (m_NumTicksR); }
00347
00348 const COLOR& GetSampleBorderColor (
00349 ) const { return (m_SampleBorderColor); }
00350
00351 double GetSampleBorderWidth (
00352 ) const { return (m_SampleBorderWidth); }
00353
00354 double GetSampleHeight (
00355 ) const { return (m_SampleHeight); }
00356
00357 double GetSampleOffset (
00358 ) const { return (m_SampleOffset); }
00359
00360 double GetSampleSpace (
00361 ) const { return (m_SampleSpace); }
00362
00363 double GetSampleWidth (
00364 ) const { return (m_SampleWidth); }
00365
00366 double GetSATableNum (
00367 ) const { return (m_SATableNum); }
00368
00369 const TEXTSTYLE& GetTextStyle (
00370 int idx
00371 ) const { return (m_Style[idx]); }
00372
00373 UINT32 GetUMaxIndex (
00374 ) const { return (m_UMaxIndex); }
00375
00376 UINT32 GetUMinIndex (
00377 ) const { return (m_UMinIndex); }
00378
00379 UINT32 GetUnits (
00380 ) const { return (m_units); }
00381
00382 UINT16 GetVersion (
00383 ) const { return (m_version); }
00384
00385 void SetBackgroundColor (
00386 const COLOR& BackgroundColor
00387 ) { m_BackgroundColor = BackgroundColor; }
00388
00389 void SetColSpace (
00390 double ColSpace
00391 ) { m_ColSpace = ColSpace; }
00392
00393 void SetColWidth (
00394 double ColWidth
00395 ) { m_ColWidth = ColWidth; }
00396
00397 void SetContrastType (
00398 INT32 ContrastType
00399 ) { m_ContrastType = ContrastType; }
00400
00401 void SetDispFlags (
00402 UINT32 DispFlags
00403 ) { m_DispFlags = DispFlags; }
00404
00405 void SetElementType (
00406 UINT16 ElementType
00407 ) { m_ElementType = ElementType; }
00408
00409 void SetLegendBorderColor (
00410 const COLOR& LegendBorderColor
00411 ) { m_LegendBorderColor = LegendBorderColor; }
00412
00413 void SetLegendBorderWidth (
00414 double LegendBorderWidth
00415 ) { m_LegendBorderWidth = LegendBorderWidth; }
00416
00417 void SetLineSpace (
00418 double LineSpace
00419 ) { m_LineSpace = LineSpace; }
00420
00421 void SetMapScale (
00422 double MapScale
00423 ) { m_MapScale = MapScale; }
00424
00425 void SetMarginWidth (
00426 double MarginWidth
00427 ) { m_MarginWidth = MarginWidth; }
00428
00429 void SetMaxIndex (
00430 double MaxIndex
00431 ) { m_MaxIndex = MaxIndex; }
00432
00433 void SetMinIndex (
00434 double MinIndex
00435 ) { m_MinIndex = MinIndex; }
00436
00437 void SetMaxL (
00438 double MaxL
00439 ) { m_MaxL = MaxL; }
00440
00441 void SetMaxR (
00442 double MaxR
00443 ) { m_MaxR = MaxR; }
00444
00445 void SetMinL (
00446 double MinL
00447 ) { m_MinL = MinL; }
00448
00449 void SetMinR (
00450 double MinR
00451 ) { m_MinR = MinR; }
00452
00453 void SetNumCols (
00454 UINT32 NumCols
00455 ) { m_numcols = NumCols; }
00456
00457 void SetNumTicksL (
00458 UINT32 NumTicksL
00459 ) { m_NumTicksL = NumTicksL; }
00460
00461 void SetNumTicksR (
00462 UINT32 NumTicksR
00463 ) { m_NumTicksR = NumTicksR; }
00464
00465 void SetSampleBorderColor (
00466 const COLOR& SampleBorderColor
00467 ) { m_SampleBorderColor = SampleBorderColor; }
00468
00469 void SetSampleBorderWidth (
00470 double SampleBorderWidth
00471 ) { m_SampleBorderWidth = SampleBorderWidth; }
00472
00473 void SetSampleHeight (
00474 double SampleHeight
00475 ) { m_SampleHeight = SampleHeight; }
00476
00477 void SetSampleOffset (
00478 double SampleOffset
00479 ) { m_SampleOffset = SampleOffset; }
00480
00481 void SetSampleSpace (
00482 double SampleSpace
00483 ) { m_SampleSpace = SampleSpace; }
00484
00485 void SetSampleWidth (
00486 double SampleWidth
00487 ) { m_SampleWidth = SampleWidth; }
00488
00489 void SetSATableNum (
00490 double SATableNum
00491 ) { m_SATableNum = SATableNum; }
00492
00493 void SetTextStyle (
00494 int idx,
00495 const TEXTSTYLE& style
00496 ) { m_Style[idx] = style; }
00497
00498 void SetUMaxIndex (
00499 UINT32 UMaxIndex
00500 ) { m_UMaxIndex = UMaxIndex; }
00501
00502 void SetUMinIndex (
00503 UINT32 UMinIndex
00504 ) { m_UMinIndex = UMinIndex; }
00505
00506 void SetUnits (
00507 UINT32 Units
00508 ) { m_units = Units; }
00509
00510 void SetVersion (
00511 UINT16 Version
00512 ) { m_version = Version; }
00513
00514 private:
00515 #ifndef GENERATING_DOXYGEN_OUTPUT
00516 double m_MapScale;
00517 double m_ColSpace;
00518 double m_ColWidth;
00519 double m_SampleSpace;
00520 double m_SampleHeight;
00521 double m_SampleWidth;
00522 double m_LineSpace;
00523 double m_SATableNum;
00524 double m_SampleOffset;
00525 INT32 m_ContrastType;
00526 COLOR m_BackgroundColor;
00527 TEXTSTYLE m_Style[4];
00528 UINT16 m_ElementType;
00529 UINT16 m_version;
00530 UINT32 m_units;
00531 UINT32 m_numcols;
00532 UINT32 m_DispFlags;
00533 COLOR m_SampleBorderColor;
00534 COLOR m_LegendBorderColor;
00535 double m_SampleBorderWidth;
00536 double m_LegendBorderWidth;
00537 double m_MarginWidth;
00538 double m_MinL;
00539 double m_MaxL;
00540 double m_MinR;
00541 double m_MaxR;
00542 UINT32 m_UMinIndex;
00543 UINT32 m_UMaxIndex;
00544 UINT32 m_NumTicksL;
00545 UINT32 m_NumTicksR;
00546 double m_MinIndex;
00547 double m_MaxIndex;
00548 #endif // GENERATING_DOXYGEN_OUTPUT
00549 };
00550
00551 #ifndef GENERATING_DOXYGEN_OUTPUT
00552 DEFINE_ENUM_OP_BITWISE(LEGEND::LINE::FLAGS)
00553 #endif
00554
00555 }
00556
00557 #endif // INC_RVC_LEGEND_H