view.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 VIEW_HEADER
00020 #define VIEW_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 
00029 class WT_File;
00030 
00035 
00036 
00040 class WHIPTK_API WT_View : public WT_Attribute
00041 {
00042         friend class WT_Rendering_Options;
00043         friend class WT_W2D_Class_Factory;
00044         friend class WT_Opcode;
00045 
00046 private:
00047     WT_Logical_Box        m_view;
00048     WT_String            m_name;
00049     WT_Boolean          m_set_by_name;
00050 
00051     enum
00052     {
00053         Eating_Initial_Whitespace,
00054         Determining_String_Or_View,
00055         Getting_View,
00056         Eating_Trailing_Whitespace
00057     } m_stage;
00058 
00059 public:
00060 
00062 
00063     WT_View()
00064         : m_set_by_name (WD_False)
00065         , m_stage(Eating_Initial_Whitespace)
00066     { }
00067 
00069     WT_View(WT_Logical_Box view)
00070         : m_view(view)
00071         , m_set_by_name (WD_False)
00072         , m_stage(Eating_Initial_Whitespace)
00073     { }
00074 
00076     WT_View(char * name)
00077         : m_set_by_name (WD_True)
00078         , m_stage(Eating_Initial_Whitespace)
00079     {   set (name); }
00080 
00082     WT_View(WT_View const & view) // Copy
00083         : WT_Attribute()
00084         , m_set_by_name (WD_False)
00085         , m_stage(Eating_Initial_Whitespace)
00086     {
00087         set (view.name());
00088         set (view.view());
00089     }
00090         virtual ~WT_View()
00091         {}
00093 public:
00095 
00096     WT_String const &      name() const { return m_name; }
00098     void                   set (char const * name);
00100     void                   set (WT_Unsigned_Integer16 const * name);
00102     void                   set (WT_String const & name);
00104     void                   set (WT_Logical_Box const & view);
00105     WT_Logical_Box const & view() const { return m_view; }
00107     WT_View const & operator=(WT_View const & view);
00109 
00111     WT_ID            object_id() const;
00112     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00113     WT_Result        process(WT_File & file);
00114     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00115     WT_Result        serialize (WT_File & file) const;
00116     WT_Result        sync (WT_File & file) const;
00117     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00119 
00121 
00123     static WT_Result default_process(
00124         WT_View & item, 
00125         WT_File & file 
00126         );
00127 
00128 };
00129 
00131 
00132 #endif // VIEW_HEADER

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