embed.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 EMBED_HEADER
00020 #define EMBED_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/object.h"
00028 
00029 class WT_File;
00030 
00036 
00037 
00038 class WHIPTK_API WT_Embed : public WT_Object
00039 {
00040         friend class WT_W2D_Class_Factory;
00041         friend class WT_Opcode;
00042 
00043 private:
00044 
00045     enum WT_Materialize_Stage
00046     {
00047         Eating_Initial_Whitespace,
00048         Gathering_MIME,
00049         Eating_Post_MIME_Whitespace,
00050         Gathering_Description,
00051         Eating_Post_Description_Whitespace,
00052         Gathering_Filename,
00053         Eating_Post_Filename_Whitespace,
00054         Gathering_URL,
00055         Eating_Trailing_Whitespace
00056     };
00057 
00058     WT_String                m_MIME_type;
00059     WT_String                m_MIME_subtype;
00060     WT_String                m_MIME_options;
00061     WT_String                m_description;
00062     WT_String                m_filename;
00063     WT_String                m_url;
00064     WT_Materialize_Stage    m_stage;
00065     int                        m_incarnation;
00066 
00067 public:
00068 
00070 
00071     WT_Embed()
00072         : m_stage(Eating_Initial_Whitespace)
00073         , m_incarnation(-1)
00074     { }
00076     WT_Embed(WT_Embed const & embed);
00078         virtual ~WT_Embed()
00079         {}
00080 public:
00081 
00083 
00084     WT_String const & description() const { return m_description;    }
00086     WT_String const & filename() const { return m_filename;    }
00088     WT_String const & MIME_options() const { return m_MIME_options;    }
00090 
00091     WT_String const & MIME_subtype() const { return m_MIME_subtype;    }
00093 
00094     WT_String const & MIME_type() const  { return m_MIME_type; }
00096     WT_Result         set_description(char const * description, WT_File & file);
00098     WT_Result         set_description(WT_Unsigned_Integer16 const * description, WT_File & file);
00100     WT_Result         set_filename(char const * filename, WT_File & file);
00102     WT_Result         set_filename(WT_Unsigned_Integer16 const * filename, WT_File & file);
00104     WT_Result         set_MIME_options(char const * options, WT_File & file);
00106     WT_Result         set_MIME_options(WT_Unsigned_Integer16 const * options, WT_File & file);
00108 
00109     WT_Result         set_MIME_subtype(char const * subtype, WT_File & file);
00111 
00112     WT_Result         set_MIME_subtype(WT_Unsigned_Integer16 const * subtype, WT_File & file);
00114 
00115     WT_Result         set_MIME_type(char const * type, WT_File & file);
00117 
00118     WT_Result         set_MIME_type(WT_Unsigned_Integer16 const * type, WT_File & file);
00120     WT_Result         set_url(char const * url, WT_File & file);
00122     WT_Result         set_url(WT_Unsigned_Integer16 const * url, WT_File & file);
00124     WT_Result         set_whole_MIME(char const * mime, WT_File & file);
00126     WT_String const & url() const { return m_url;    }
00128     WT_Embed const &  operator=(WT_Embed const & embed);
00130     WT_Boolean  operator== (WT_Object const & object) const;
00131 
00133     WT_ID            object_id() const;
00134     WT_Type          object_type() const;
00135     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00136     WT_Result        process(WT_File & file);
00137     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00138     WT_Result        serialize (WT_File & file) const;
00140 
00142 
00144     static WT_Result default_process(
00145         WT_Embed & item, 
00146         WT_File & file 
00147         );
00148 };
00149 
00151 
00152 #endif // EMBED_HEADER

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