Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

object.h

00001 //  Copyright (c) 1996-2002 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 #if !defined OBJECT_HEADER
00019 #define OBJECT_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 
00023 //class WT_File;
00024 class WT_Opcode;
00025 
00027 class WHIPTK_API WT_Object
00028 {
00029 public:
00031     enum WT_ID
00032     {
00033          Unknown_ID
00034         ,Adapt_Line_Patterns_ID
00035         ,Author_ID
00036         ,Background_ID
00037         ,Code_Page_ID
00038         ,Color_ID
00039         ,Color_Map_ID
00040         ,Comments_ID
00041         ,Compressed_Data_Moniker_ID
00042         ,Contour_Set_ID
00043         ,Copyright_ID
00044         ,Creator_ID
00045         ,Creation_Time_ID
00046         ,Dash_Pattern_ID
00047         ,Description_ID
00048         ,Drawing_Info_ID
00049         ,DWF_Header_ID
00050         ,Embed_ID
00051         ,Embedded_Font_ID
00052         ,End_Of_DWF_ID
00053         ,Fill_ID
00054         ,Fill_Pattern_ID
00055         ,Filled_Ellipse_ID
00056         ,Gouraud_Polyline_ID
00057         ,Gouraud_Polytriangle_ID
00058         ,Image_ID
00059         ,Inked_Area_ID
00060         ,Keywords_ID
00061         ,Layer_ID
00062         ,Layer_List_ID
00063         ,Line_Caps_ID
00064         ,Line_Join_ID
00065         ,Line_Pattern_ID
00066         ,Line_Style_ID
00067         ,Line_Pattern_Scale_ID
00068         ,Line_Weight_ID
00069         ,Marker_Size_ID
00070         ,Marker_Symbol_ID
00071         ,Merge_Control_ID
00072         ,Miter_Angle_ID
00073         ,Miter_Length_ID
00074         ,Modification_Time_ID
00075         ,Named_View_ID
00076         ,Named_View_List_ID
00077         ,Trusted_Font_List_ID
00078         ,Object_Node_ID
00079         ,Object_Node_List_ID
00080         ,Option_ID
00081         ,Origin_ID
00082         ,Outline_Ellipse_ID
00083         ,Plot_Info_ID
00084         ,Polygon_ID
00085         ,Polyline_ID
00086         ,Polymarker_ID
00087         ,Polytriangle_ID
00088         ,Projection_ID
00089         ,Source_Creation_Time_ID
00090         ,Source_Filename_ID
00091         ,Source_Modification_Time_ID
00092         ,Subject_ID
00093         ,Text_ID
00094         ,Title_ID
00095         ,Units_ID
00096         ,URL_ID
00097         ,URL_List_ID
00098         ,View_ID
00099         ,Viewport_ID
00100         ,Viewport_Option_Viewport_Units_ID
00101         ,Visibility_ID
00102         ,Font_ID
00103         ,Font_Option_Font_Name_ID
00104         ,Font_Option_Charset_ID
00105         ,Font_Option_Pitch_ID
00106         ,Font_Option_Family_ID
00107         ,Font_Option_Style_ID
00108         ,Font_Option_Height_ID
00109         ,Font_Option_Rotation_ID
00110         ,Font_Option_Width_Scale_ID
00111         ,Font_Option_Spacing_ID
00112         ,Font_Option_Oblique_ID
00113         ,Font_Option_Flags_ID
00114         ,Text_Option_Overscore_ID
00115         ,Text_Option_Underscore_ID
00116         ,Text_Option_Bounds_ID
00117         ,Text_Option_Reserved_ID
00118         ,PNG_Group4_Image_ID
00119         ,Optimized_For_Plot_ID
00120         ,Group_Begin_ID
00121         ,Group_End_ID
00122         ,Block_Meaning_ID
00123         ,Encryption_ID
00124         ,Orientation_ID
00125         ,Alignment_ID
00126         ,Password_ID
00127         ,Guid_ID
00128         ,FileTime_ID
00129         ,BlockRef_ID
00130         ,Directory_ID
00131         ,UserData_ID
00132         ,Pen_Pattern_ID
00133         ,SignData_ID
00134         ,Guid_List_ID
00135         ,Font_Extension_ID
00136         ,PenPat_Options_ID
00137     };
00138 
00140     enum WT_Type
00141     {
00142          Unknown
00143         ,Attribute
00144         ,Drawable
00145         ,Definition
00146         ,Compression
00147         ,Comment
00148         ,Wrapper
00149         ,Option
00150         ,Informational
00151     };
00152 
00153 protected:
00154     WT_Boolean    m_materialized; 
00156 public:
00157 
00159     WT_Object ()
00160         : m_materialized(WD_False)
00161     { }
00162 
00164     virtual ~WT_Object ()
00165     { }
00166 
00168     virtual WT_Type    object_type() const = 0;
00169 
00171     virtual WT_ID      object_id() const = 0;
00172 
00174 
00180     virtual WT_Result        materialize(
00181         WT_Opcode const & opcode, 
00182         WT_File & file 
00183         ) = 0;
00184 
00186 
00188     virtual WT_Result        process(WT_File & file) = 0;
00189 
00191 
00197     virtual WT_Result        serialize (
00198         WT_File & file 
00199         ) const = 0;
00200 
00202 
00209     virtual WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00210 
00212     WT_Boolean    materialized() const
00213     {
00214         return m_materialized;
00215     }
00216 };
00217 
00218 class WT_Optioncode;
00219 
00221 class WHIPTK_API WT_Option : public WT_Object
00222 {
00223 public:
00224 
00226     enum
00227     {
00228         Getting_Operand,
00229         Getting_Close_Paren,
00230         Completed
00231     };
00232 
00234     int m_stage; 
00236 
00237     WT_Option()
00238         : m_stage (Getting_Operand)
00239     { }
00240 
00242     WT_Type    object_type() const
00243     {
00244         return Option;
00245     }
00246 
00248     virtual WT_Result    materialize(WT_Opcode const & /* opcode */, WT_File & /* file */) {
00249         return WT_Result::Toolkit_Usage_Error;
00250     }
00251 
00253     virtual WT_Result    materialize (
00254         WT_Object & parent, 
00255         WT_Optioncode const & optioncode, 
00256         WT_File & file 
00257         ) = 0;
00258 
00260 
00262     virtual WT_Result    process(WT_File & file);
00263 
00265     virtual WT_Result    serialize (WT_File & /* file */) const {
00266         return WT_Result::Toolkit_Usage_Error;
00267     }
00268 
00270     virtual WT_Result    serialize   (
00271         WT_Object const & parent, 
00272         WT_File & file 
00273         ) const = 0;
00274 
00276 
00278     virtual WT_Result    skip_operand(WT_Optioncode const & optioncode, WT_File & file);
00279 };
00280 
00281 #endif // OBJECT_HEADER

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1