00001 /** 00002 * \file lrtext.h <gre/lrtext.h> 00003 * \brief GRE_LAYER_TEXT class definitions 00004 * 00005 * \if NODOC 00006 * $Id: lrtext.h_v 1.14 2005/04/21 20:26:37 mju Exp $ 00007 * 00008 * $Log: lrtext.h_v $ 00009 * Revision 1.14 2005/04/21 20:26:37 mju 00010 * Remove unused flag. 00011 * 00012 * Revision 1.13 2005/03/31 16:57:06 fileserver!dwilliss 00013 * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define 00014 * 00015 * Revision 1.12 2005/02/25 23:46:55 scowan 00016 * Added copy virtual method implementation. 00017 * 00018 * Revision 1.11 2005/02/14 21:39:49 mju 00019 * use device in usesTransparency. 00020 * 00021 * Revision 1.10 2005/01/20 16:57:47 mju 00022 * Redesign layer type registration. 00023 * 00024 * Revision 1.9 2004/10/15 21:29:30 ldyas 00025 * added needsmem24 method 00026 * 00027 * Revision 1.8 2004/10/15 14:32:47 ldyas 00028 * *** empty log message *** 00029 * 00030 * Revision 1.7 2004/10/14 22:05:38 ldyas 00031 * isantialiased is nonconst. 00032 * 00033 * Revision 1.6 2004/10/07 14:28:12 ldyas 00034 * added method for to allow IsAntialiased to detect smoothing in text style. 00035 * 00036 * Revision 1.5 2004/03/05 21:29:24 mju 00037 * Make dtor virtual if virtual fns. 00038 * 00039 * Revision 1.4 2004/02/18 23:37:30 scowan 00040 * Forward declare the text block from mgd namespace. 00041 * 00042 * Revision 1.3 2003/09/15 13:48:59 fileserver!dwilliss 00043 * Doxygen 00044 * 00045 * Revision 1.2 2003/07/30 15:29:08 mju 00046 * Ignore private sections. 00047 * 00048 * Revision 1.1 2002/09/20 17:47:44 mju 00049 * Initial revision 00050 * 00051 * \endif 00052 **/ 00053 00054 #ifndef INC_GRE_LRTEXT_H 00055 #define INC_GRE_LRTEXT_H 00056 00057 #ifndef INC_MI32_GRE_H 00058 #include <mi32/gre.h> 00059 #endif 00060 00061 namespace MGD { 00062 struct TEXTBLOCK; 00063 } 00064 00065 //=================================================================================================================== 00066 00067 class GRE_LAYER_TEXT : public GRE_LAYER { 00068 public: 00069 00070 class DISPPARM : public GRE_LAYER::DISPPARM { 00071 public: 00072 00073 class DLG; 00074 00075 MIUNICODE filename[FILENAME_MAX]; //!< Filename of the object 00076 RVCTEXTINFO objinfo; 00077 MISTRING Text; 00078 MISTRING encoding; 00079 TEXTSTYLE Style; 00080 time_t LastModTime; //!< Used to determine if linked file has changed 00081 char* String; //!< For backwards compatibility 00082 00083 DISPPARM (GRE_LAYER_TEXT *layer); 00084 00085 DISPPARM (const DISPPARM& rhs) { Copy(rhs); } 00086 00087 virtual ~DISPPARM () { Free(); } 00088 00089 DISPPARM& operator= (const DISPPARM& rhs) { 00090 if (this != &rhs) { 00091 Free(); 00092 Copy(rhs); 00093 } 00094 return (*this); 00095 } 00096 00097 //! Validate dispparm, adjusting if possible. 00098 virtual ERRVALUE Validate (); 00099 00100 protected: 00101 virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const; 00102 00103 private: 00104 #ifndef GENERATING_DOXYGEN_OUTPUT 00105 GRE_LAYER_TEXT *m_layer; 00106 void Copy (const DISPPARM&); 00107 void Free (); 00108 #endif //!< GENERATING_DOXYGEN_OUTPUT 00109 }; 00110 00111 //! Register this layer type 00112 static void RegisterType ( 00113 ); 00114 00115 //! Install SML class, called by internal SML function. 00116 static void SMLClassInstall ( 00117 SMLCONTEXT *context //!< SML context 00118 ); 00119 00120 //! Construct layer and insert into list 00121 explicit GRE_LAYER_TEXT ( 00122 GRE_GROUP *group, //!< Group to contain layer 00123 CREATEFLAGS createflags = CREATEFLAG_None //!< Creation flags 00124 ); 00125 00126 //! Destructor. 00127 virtual ~GRE_LAYER_TEXT (); 00128 00129 //! Retrieve layer-specific display parameters. 00130 const DISPPARM& GetDispParm ( 00131 ) const { return (m_dispparm); } 00132 00133 //! Set layer-specific display parameters. 00134 //! This is the recommended method for changing how an existing layer is to be 00135 //! rendered. Validation will be performed on the specified parameters and 00136 //! adjustments made to the layer's copy if necessary. Use of this method 00137 //! usually result in a ChangeBegin / ChangeEnd message pair, and will also 00138 //! generate a ChangeObject message if the spatial object used in the layer 00139 //! is changed. 00140 ERRVALUE SetDispParm ( 00141 const DISPPARM& dispparm //!< Parameters to set 00142 ); 00143 00144 protected: 00145 00146 DISPPARM m_dispparm; //!< Layer-specific display parameters 00147 00148 private: 00149 #ifndef GENERATING_DOXYGEN_OUTPUT 00150 00151 void CleanupTextBlock (MGD::TEXTBLOCK&); 00152 ERRVALUE SetupTextBlock (MGD::TEXTBLOCK&); 00153 00154 //! Overrides from GRE_LAYER. 00155 #if defined(X_NATIVE) || defined(WIN32_MFC) 00156 virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0); 00157 #endif 00158 virtual GRE_LAYER* v_Copy (GRE_GROUP *group) const; 00159 virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc); 00160 virtual const RVC::OBJITEM& v_GetObjItem (int component) const; 00161 virtual bool v_IsAntialiased () const; 00162 virtual bool v_NeedsMEM24 (bool hirez) const; 00163 virtual const char* v_SerialGetTagName () const; 00164 virtual ERRVALUE v_SerialRead (SERIALIZER& serializer); 00165 virtual void v_SetDftName (bool ReplaceExisting); 00166 virtual ERRVALUE v_TemplateRead (SERIALIZER& serializer); 00167 virtual int v_UpdateExtents (bool forceupdate); 00168 virtual bool v_UsesTransparency (const MGD::DEVICE *pDevice = 0) const; 00169 00170 GRE_LAYER_TEXT (const GRE_LAYER_TEXT&); 00171 GRE_LAYER_TEXT& operator= (const GRE_LAYER_TEXT&); 00172 00173 #endif //!< GENERATING_DOXYGEN_OUTPUT 00174 }; 00175 00176 #define TEXTDISPFLAG_Link 0x00000002 //!< Link to a file 00177 #define TEXTDISPFLAG_RVCObject 0x00000004 //!< Link is RVC object 00178 00179 //=================================================================================================================== 00180 00181 00182 #endif //!< INC_GRE_LRTEXT_H
1.3.8-20040913