lrtext.h

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

Generated on Tue Dec 14 13:18:14 2004 for TNTsdk by  doxygen 1.3.8-20040913