lweight.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 LWEIGHT_HEADER
00024 #define LWEIGHT_HEADER
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 
00029 class WT_File;
00030 
00035 
00036 
00039 class WHIPTK_API WT_Line_Weight
00040 : public WT_Attribute
00041 {
00042         friend class WT_Rendition;
00043         friend class WT_W2D_Class_Factory;
00044         friend class WT_Opcode;
00045 
00046 public:
00047 
00049 
00050     WT_Line_Weight()
00051     : m_weight(0)
00052     , m_stage(Eating_Initial_Whitespace)
00053     {}
00055     WT_Line_Weight(
00056         WT_Integer32 weight 
00057         )
00058     : m_weight(weight)
00059     , m_stage(Eating_Initial_Whitespace)
00060     {}
00061 
00063     WT_Line_Weight(
00064         WT_Line_Weight const &copy
00065         )
00066     : m_weight( copy.m_weight )
00067     , m_stage( copy.m_stage )
00068     {}
00069 
00070         virtual ~WT_Line_Weight()
00071         {}
00073 public:
00075 
00076     inline WT_Integer32 const & weight_value() const { return m_weight; }
00078     inline WT_Integer32&        weight_value()       { return m_weight; }
00080     inline WT_Line_Weight& operator=(
00081         WT_Integer32 weight 
00082         ) { m_weight = weight; return *this; }
00084 
00086     WT_ID            object_id() const;
00087     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00088     WT_Result        process(WT_File & file);
00089     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00090     WT_Result        serialize (WT_File & file) const;
00091     WT_Result        sync (WT_File & file) const;
00092     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00094     inline WT_Boolean operator == ( WT_Integer32 weight ) const { return weight == m_weight; }
00096 
00098 
00100     static WT_Result default_process(
00101         WT_Line_Weight & item, 
00102         WT_File & file 
00103         );
00104 
00105 
00106 private:
00107     WT_Integer32 m_weight;
00108     enum WT_Materialize_Stage
00109     {   Eating_Initial_Whitespace,
00110         Getting_Weight,
00111         Eating_End_Whitespace
00112     } m_stage;
00113 };
00114 
00116 
00117 #endif // LWEIGHT_HEADER

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