object.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 OBJECT_HEADER
00024 #define OBJECT_HEADER
00025 
00026 #include "whiptk/whipcore.h"
00027 
00028 //class WT_File;
00029 class WT_Opcode;
00030 
00032 class WHIPTK_API WT_Object
00033 {
00034         friend class WT_Viewport;
00035         friend class WT_Object_Stream;
00036         friend class WT_File;
00037         friend class WT_Class_Factory;
00038         friend class WT_DeprecatedClassFactory;
00039 
00040 public:
00042     enum WT_ID
00043     {
00044          Unknown_ID
00045         ,Adapt_Line_Patterns_ID
00046         ,Author_ID
00047         ,Background_ID
00048         ,Code_Page_ID
00049         ,Color_ID
00050         ,Color_Map_ID
00051         ,Comments_ID
00052         ,Compressed_Data_Moniker_ID
00053         ,Contour_Set_ID
00054         ,Copyright_ID
00055         ,Creator_ID
00056         ,Creation_Time_ID
00057         ,Dash_Pattern_ID
00058         ,Description_ID
00059         ,Drawing_Info_ID
00060         ,DWF_Header_ID
00061         ,Embed_ID
00062         ,Embedded_Font_ID
00063         ,End_Of_DWF_ID
00064         ,Fill_ID
00065         ,Fill_Pattern_ID
00066         ,Filled_Ellipse_ID
00067         ,Gouraud_Polyline_ID
00068         ,Gouraud_Polytriangle_ID
00069         ,Image_ID
00070         ,Inked_Area_ID
00071         ,Keywords_ID
00072         ,Layer_ID
00073         ,Layer_List_ID
00074         ,Line_Caps_ID
00075         ,Line_Join_ID
00076         ,Line_Pattern_ID
00077         ,Line_Style_ID
00078         ,Line_Pattern_Scale_ID
00079         ,Line_Weight_ID
00080         ,Marker_Size_ID
00081         ,Marker_Symbol_ID
00082         ,Merge_Control_ID
00083         ,Miter_Angle_ID
00084         ,Miter_Length_ID
00085         ,Modification_Time_ID
00086         ,Named_View_ID
00087         ,Named_View_List_ID
00088         ,Trusted_Font_List_ID
00089         ,Object_Node_ID
00090         ,Object_Node_List_ID
00091         ,Option_ID
00092         ,Origin_ID
00093         ,Outline_Ellipse_ID
00094         ,Plot_Info_ID
00095         ,Polygon_ID
00096         ,Polyline_ID
00097         ,Polymarker_ID
00098         ,Polytriangle_ID
00099         ,Projection_ID
00100         ,Source_Creation_Time_ID
00101         ,Source_Filename_ID
00102         ,Source_Modification_Time_ID
00103         ,Subject_ID
00104         ,Text_ID
00105         ,Title_ID
00106         ,Units_ID
00107         ,URL_ID
00108         ,URL_List_ID
00109         ,View_ID
00110         ,Viewport_ID
00111         ,Viewport_Option_Viewport_Units_ID
00112         ,Visibility_ID
00113         ,Font_ID
00114         ,Font_Option_Font_Name_ID
00115         ,Font_Option_Charset_ID
00116         ,Font_Option_Pitch_ID
00117         ,Font_Option_Family_ID
00118         ,Font_Option_Style_ID
00119         ,Font_Option_Height_ID
00120         ,Font_Option_Rotation_ID
00121         ,Font_Option_Width_Scale_ID
00122         ,Font_Option_Spacing_ID
00123         ,Font_Option_Oblique_ID
00124         ,Font_Option_Flags_ID
00125         ,Text_Option_Overscore_ID
00126         ,Text_Option_Underscore_ID
00127         ,Text_Option_Bounds_ID
00128         ,Text_Option_Reserved_ID
00129         ,PNG_Group4_Image_ID
00130         ,Optimized_For_Plot_ID
00131         ,Group_Begin_ID
00132         ,Group_End_ID
00133         ,Block_Meaning_ID
00134         ,Encryption_ID
00135         ,Orientation_ID
00136         ,Alignment_ID
00137         ,Password_ID
00138         ,Guid_ID
00139         ,FileTime_ID
00140         ,BlockRef_ID
00141         ,Directory_ID
00142         ,UserData_ID
00143         ,Pen_Pattern_ID
00144         ,SignData_ID
00145         ,Guid_List_ID
00146         ,Font_Extension_ID
00147         ,PenPat_Options_ID
00148         ,Macro_Definition_ID
00149         ,Macro_Draw_ID
00150         ,Macro_Scale_ID
00151         ,Macro_Index_ID
00152         ,Text_Background_ID
00153         ,Text_HAlign_ID
00154         ,Text_VAlign_ID
00155         ,Overpost_ID
00156         ,Delineate_ID
00157         ,User_Fill_Pattern_ID
00158         ,User_Hatch_Pattern_ID
00159         ,Contrast_Color_ID
00160         ,Attribute_URL_ID
00161     };
00162 
00164     enum WT_Type
00165     {
00166          Unknown
00167         ,Attribute
00168         ,Drawable
00169         ,Definition
00170         ,Compression
00171         ,Comment
00172         ,Wrapper
00173         ,Option
00174         ,Informational
00175     };
00176 
00177 protected:
00178     WT_Boolean    m_materialized; 
00180 
00181     WT_Object ()
00182         : m_materialized(WD_False)
00183     { }
00184 
00186     virtual ~WT_Object ()
00187     { }
00188 public:
00190     virtual WT_Type    object_type() const = 0;
00191 
00193     virtual WT_ID      object_id() const = 0;
00194 
00196 
00202     virtual WT_Result        materialize(
00203         WT_Opcode const & opcode, 
00204         WT_File & file 
00205         ) = 0;
00206 
00208 
00210     virtual WT_Result        process(WT_File & file) = 0;
00211 
00213 
00219     virtual WT_Result        serialize (
00220         WT_File & file 
00221         ) const = 0;
00222 
00224 
00231     virtual WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00232 
00234     const WT_Boolean& materialized() const
00235     {
00236         return m_materialized;
00237     }
00238 
00240     WT_Boolean& materialized()
00241     {
00242         return m_materialized;
00243     }
00244 
00245 };
00246 
00247 class WT_Optioncode;
00248 
00250 class WHIPTK_API WT_Option : public WT_Object
00251 {
00252         friend class WT_W2D_Class_Factory;
00253         friend class WT_Text_Option_Scoring;
00254         friend class WT_Text_Option_Bounds;
00255         friend class WT_Text_Option_Reserved;
00256 
00257 public:
00258 
00260     enum
00261     {
00262         Getting_Operand,
00263         Getting_Close_Paren,
00264         Completed
00265     };
00266 
00268     int m_stage; 
00270 protected:
00272     WT_Option()
00273         : m_stage (Getting_Operand)
00274     { }
00275 
00276 public:
00277         virtual ~WT_Option()
00278         {}
00279 
00281     virtual WT_ID      object_id() const { return Option_ID; }
00282 
00284     WT_Type    object_type() const
00285     {
00286         return Option;
00287     }
00288 
00290     virtual WT_Result    materialize(WT_Opcode const & /* opcode */, WT_File & /* file */) {
00291         return WT_Result::Toolkit_Usage_Error;
00292     }
00293 
00295     virtual WT_Result    materialize (
00296         WT_Object & /*parent*/, 
00297         WT_Optioncode const & /*optioncode*/, 
00298         WT_File & /*file*/ 
00299         ) { return WT_Result::Toolkit_Usage_Error; }
00300 
00302 
00304     virtual WT_Result    process(WT_File & file);
00305 
00307     virtual WT_Result    serialize (WT_File & /* file */) const {
00308         return WT_Result::Toolkit_Usage_Error;
00309     }
00310 
00312     virtual WT_Result    serialize   (
00313         WT_Object const & /*parent*/, 
00314         WT_File & /*file*/ 
00315         ) const { return WT_Result::Toolkit_Usage_Error; }
00316 
00318 
00320     virtual WT_Result    skip_operand(WT_Optioncode const & optioncode, WT_File & file);
00321 };
00322 
00323 #endif // OBJECT_HEADER

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