named_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 
00022 
00023 #if !defined NAMED_VIEW_HEADER
00024 #define NAMED_VIEW_HEADER
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/list.h"
00028 #include "whiptk/object.h"
00029 
00035 
00036 class WHIPTK_API WT_Named_View : public WT_Item, public WT_Object
00037 {
00038         friend class WT_Class_Factory;
00039         friend class WT_W2D_Class_Factory;
00040         friend class WT_Opcode;
00041 
00042 private:
00043 
00044     WT_Logical_Box * m_view;
00045     WT_String        m_name;
00046     WT_Boolean       m_has_been_serialized;
00047 
00048     enum WT_Materialize_Stage
00049     {
00050         Eating_Initial_Whitespace,
00051         Gathering_View,
00052         Eating_Middle_Whitespace,
00053         Gathering_Name,
00054         Eating_End_Whitespace
00055     } m_stage;
00056 
00057     void _deleteObject(void *object)
00058     {
00059         delete (WT_Named_View*)object;
00060     }
00061 
00062 public:
00064 
00065     WT_Named_View (void)
00066         : WT_Item ()
00067         , m_view (WD_Null)
00068         , m_has_been_serialized (WD_False)
00069         , m_stage (Eating_Initial_Whitespace)
00070         { }
00071 
00073     WT_Named_View (WT_Named_View  const & named_view);
00075     WT_Named_View (WT_Logical_Box const & view, const char * name = WD_Null);
00077     WT_Named_View (WT_Logical_Box const & view, WT_Unsigned_Integer16 const * name);
00079     virtual ~WT_Named_View (void);
00080 
00082 public:
00084 
00085     WT_String const &  name () const { return m_name; }
00087     WT_Logical_Box *   view () const { return m_view; }
00089     void               set (WT_Named_View const &  named_view);
00091     void               set (WT_Logical_Box const & view);
00093     void               set (const char * name);
00095     void               set (WT_Unsigned_Integer16 const * name);
00097     void               set (WT_String const & name);
00099     void               set (int length, WT_Unsigned_Integer16 const * name);
00101     WT_Named_View const & operator= (WT_Named_View const & named_view);
00103     WT_Boolean       operator== (WT_Named_View const & named_view) const;
00105     virtual WT_Named_View* copy() const;
00107 
00108 
00110     WT_ID            object_id() const;
00111     WT_Type          object_type() 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;
00118 
00120 
00122     static WT_Result default_process(
00123         WT_Named_View  & item, 
00124         WT_File & file 
00125         );
00126 
00127 };
00128 
00130 
00131 #endif // NAMED_VIEW_HEADER

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