gre/datatip.h

Go to the documentation of this file.
00001 /**
00002  * \file gre/datatip.h
00003  * \brief GRE DataTip definitions
00004  *
00005  * \if NODOC
00006  * $Id: datatip.h_v 1.4 2006/12/06 22:09:45 dwilliss Exp $
00007  *
00008  * $Log: datatip.h_v $
00009  * Revision 1.4  2006/12/06 22:09:45  dwilliss
00010  * Added support for images mixed with text
00011  *
00012  * Revision 1.3  2006/10/02 20:52:02  mju
00013  * Add checkField.
00014  *
00015  * Revision 1.1  2006/09/28 13:04:23  mju
00016  * Initial revision
00017  *
00018  * \endif
00019 **/
00020 
00021 #ifndef  INC_GRE_DATATIP_H
00022 #define  INC_GRE_DATATIP_H
00023 
00024 #ifndef  INC_RVC_OBJECTNAME_H
00025    #include <rvc/objectname.h>
00026 #endif
00027 
00028 #ifndef  INC_MI32_ELEMTYPE_H
00029    #include <mi32/elemtype.h>
00030 #endif
00031 
00032 #ifndef  GENERATING_DOXYGEN_OUTPUT
00033 class SERIALIZERITEM;
00034 namespace RVC {
00035    class DBTABLE;
00036    }
00037 namespace SPATMOD {
00038    namespace IMAGE {
00039       class STAGE_ARRAY;
00040       }
00041    }
00042 #endif
00043 
00044 
00045 namespace GRE {
00046 
00047 //! DataTip parameters.
00048 struct DATATIPPARMS {
00049    public:
00050       #ifndef GENERATING_DOXYGEN_OUTPUT
00051       class FORM;
00052       #endif // GENERATING_DOXYGEN_OUTPUT
00053 
00054       //! Built-in datatip values.
00055       // At present only one value is allowed, however defined as bits so could allow multiple in future
00056       enum PREDEFINED {
00057          PREDEFINED_None =             0x00,
00058          PREDEFINED_ImageCellValue =   0x01,
00059          PREDEFINED_LinkTileName =     0x02,
00060          };
00061 
00062       RVC::OBJECTNAME TableName;             //!< Table name
00063       RVC::OBJECTNAME FieldName;             //!< Field name
00064       INT32 TableNum;                        //!< Table number
00065       mutable INT32 FieldNum;                //!< Field number
00066       UINT8 Visible;                         //!< Show this DataTip
00067       UINT8 IsNumeric;                       //!< Set if field is numeric
00068       UINT8 UnitType;                        //!< Field unit type, here for validation against DBFIELDINFO
00069       UINT8 m_Predefined;                    //!< Predefined value to show
00070       UINT8 UnitShown;                       //!< Unit to show field in
00071       UINT8 DecPlaces;                       //!< Decimal places for floating-point fields
00072       UINT8 NoChgField;                      //!< Set if user cannot change field (eg. for RGB raster)
00073       UINT8 HighlightElem;                   //!< Set to highlight element in view when datatip shown
00074       MISTRING Prefix;                       //!< Label to place before value in string, defaults to table.field name
00075       MISTRING Suffix;                       //!< Label to place after value in string, defaults to unit name
00076 
00077       //! Get serialization item definition array.
00078       static const SERIALIZERITEM *GetSerialItemDef();
00079 
00080       //! Default constructor.
00081       DATATIPPARMS (
00082          );
00083 
00084       DATATIPPARMS (
00085          const DATATIPPARMS& rhs
00086          );
00087 
00088       DATATIPPARMS& operator= (
00089          const DATATIPPARMS& rhs
00090          );
00091 
00092       //! Check field name for validity in specified table
00093       ERRVALUE CheckField (
00094          RVC::DBTABLE& ObjTable
00095          );
00096 
00097       //! Do string formatting with prefix/suffix.
00098       void FormatString (
00099          MISTRING& ostr,                  //!< String to append to
00100          const MISTRING& istr             //!< DataTip value
00101          ) const;
00102 
00103       //! Read string from table with minimal formatting
00104       //! @return TRUE if have value, FALSE if not, < 0 if error.
00105       int ReadString (
00106          RVC::DBTABLE& ObjTable,          //!< Table to read from
00107          ELEMTYPE ElemType,               //!< Element type
00108          INT32 ElemNum,                   //!< Element number
00109          MISTRING& string,                //!< String to append result to
00110          SPATMOD::IMAGE::STAGE_ARRAY& images, //!< Images to insert into the string in place of {~IMG #} tags
00111          RVC::DBTABLE *pSourceTable = 0   //!< Source table if required
00112          ) const;
00113 
00114       //! Read string from table and format with prefix/suffix.
00115       //! @return TRUE if have value, FALSE if not, < 0 if error.
00116       int ReadStringFormatted (
00117          RVC::DBTABLE& ObjTable,          //!< Table to read from
00118          ELEMTYPE ElemType,               //!< Element type
00119          INT32 ElemNum,                   //!< Element number
00120          MISTRING& string,                //!< String to append result to
00121          SPATMOD::IMAGE::STAGE_ARRAY& images, //!< Images to insert into the string in place of {~IMG #} tags
00122          RVC::DBTABLE *pSourceTable = 0   //!< Source table if required
00123          ) const;
00124 
00125       //! Set suffix to default based on unit type/shown.
00126       void SetDefaultSuffix (
00127          );
00128 
00129    };
00130 
00131 }  // End namespace GRE
00132 
00133 #endif   // INC_GRE_DATATIP_H

Generated on Thu Apr 26 04:03:31 2007 for TNTsdk by  doxygen 1.5.2