font_extension.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 #if !defined FONT_EXTENSION_HEADER
00020 #define FONT_EXTENSION_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 
00029 class WT_File;
00030 
00031 
00036 
00037 
00041 class WHIPTK_API WT_Font_Extension : public WT_Attribute
00042 {
00043         friend class WT_Rendition;
00044         friend class WT_W2D_Class_Factory;
00045         friend class WT_Opcode;
00046 
00047 private:
00048     WT_String   m_logfont_name;
00049     WT_String   m_cannonical_name;
00050 
00051     enum WT_Materialize_Stage
00052     {
00053         Eating_Initial_Whitespace,
00054         Gathering_LogFont_Name,
00055         Eating_Middle_Whitespace,
00056         Gathering_Cannonical_Name,
00057         Eating_End_Whitespace
00058     }   m_stage;
00059 
00060 public:
00061 
00063 
00064     WT_Font_Extension()
00065     {  m_stage = Eating_Initial_Whitespace; }
00066 
00068     WT_Font_Extension(
00069         WT_String logfont_name, 
00070         WT_String cannonical_name 
00071         )
00072     {
00073         m_logfont_name = logfont_name;
00074         m_cannonical_name = cannonical_name;
00075         m_stage = Eating_Initial_Whitespace;
00076     }
00077 
00078         virtual ~WT_Font_Extension()
00079         {}
00081 
00082 public:
00084 
00085     WT_String const& cannonical_name() const {    return m_cannonical_name;    }
00087     WT_String const& logfont_name() const {    return m_logfont_name;    }
00089     void set_cannonical_name(WT_String cannonical_name) {    m_cannonical_name = cannonical_name;    }
00091     void set_logfont_name(WT_String logfont_name) {    m_logfont_name = logfont_name;    }
00092 
00093     WT_Font_Extension const & operator=  (WT_Font_Extension const & font)
00094     {
00095         set_cannonical_name( font.m_cannonical_name );
00096         set_logfont_name( font.m_logfont_name );
00097         return *this;
00098     }
00100 
00102     WT_ID            object_id() const;
00103     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00104     WT_Result        process(WT_File & file);
00105     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00106     WT_Result        serialize (WT_File & file) const;
00107     WT_Result        sync (WT_File & file) const;
00108     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00110 
00112 
00114     static WT_Result default_process(
00115         WT_Font_Extension & item, 
00116         WT_File & file 
00117         );
00118 };
00120 
00121 #endif // FONT_EXTENSION_HEADER

Generated on Tue Jan 6 22:41:12 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5