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

dwginfo.h

00001 //  Copyright (c) 1996-2001 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 DWGINFO_HEADER
00019 #define DWGINFO_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 #include "whiptk/timestamp.h"
00023 #include "whiptk/informational.h"
00024 #include "whiptk/named_view_list.h"
00025 #include "whiptk/units.h"
00026 
00027 #define WHIP_DRAWING_INFO_LIST\
00028     WHIP_DRAWING_INFO_MACRO(Author,author)\
00029     WHIP_DRAWING_INFO_MACRO(Comments,comments)\
00030     WHIP_DRAWING_INFO_MACRO(Copyright,copyright)\
00031     WHIP_DRAWING_INFO_MACRO(Creation_Time,creation_time)\
00032     WHIP_DRAWING_INFO_MACRO(Creator,creator)\
00033     WHIP_DRAWING_INFO_MACRO(Description,description)\
00034     WHIP_DRAWING_INFO_MACRO(Keywords,keywords)\
00035     WHIP_DRAWING_INFO_MACRO(Modification_Time,modification_time)\
00036     WHIP_DRAWING_INFO_MACRO(Named_View_List,named_view_list)\
00037     WHIP_DRAWING_INFO_MACRO(Source_Creation_Time,source_creation_time)\
00038     WHIP_DRAWING_INFO_MACRO(Source_Filename,source_filename)\
00039     WHIP_DRAWING_INFO_MACRO(Source_Modification_Time,source_modification_time)\
00040     WHIP_DRAWING_INFO_MACRO(Subject,subject)\
00041     WHIP_DRAWING_INFO_MACRO(Title,title)\
00042     WHIP_DRAWING_INFO_MACRO(Units,units)
00043 
00048 
00049 
00056 class WHIPTK_API WT_Drawing_Info
00057 {
00058     friend class WT_DWF_Header;
00059 
00060 private:
00061 
00062     WT_Integer32    m_changed;
00063     int             m_major_revision;
00064     int             m_minor_revision;
00065 
00066     #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower) \
00067         WT_##class_type            m_##class_lower;
00068         WHIP_DRAWING_INFO_LIST
00069     #undef WHIP_DRAWING_INFO_MACRO
00070 
00071     void set_major_revision(int rev)
00072     {
00073         m_major_revision = rev;
00074         m_changed = WD_True;
00075     }
00076 
00077     void set_minor_revision(int rev)
00078     {
00079         m_minor_revision = rev;
00080         m_changed = WD_True;
00081     }
00082 
00083 public:
00085     enum WT_Drawing_Info_Bits
00086     {
00087         Description_Bit                 = 0x00000001,
00088         Author_Bit                      = 0x00000002,
00089         Comments_Bit                    = 0x00000004,
00090         Creator_Bit                     = 0x00000008,
00091         Creation_Time_Bit               = 0x00000010,
00092         Modification_Time_Bit           = 0x00000020,
00093         Source_Filename_Bit             = 0x00000040,
00094         Source_Creation_Time_Bit        = 0x00000080,
00095         Source_Modification_Time_Bit    = 0x00000100,
00096         Named_View_List_Bit             = 0x00000200,
00097         Units_Bit                       = 0x00000400,
00098         Copyright_Bit                   = 0x00000800,
00099         Keywords_Bit                    = 0x00001000,
00100         Title_Bit                       = 0x00002000,
00101         Subject_Bit                     = 0x00004000
00102     };
00103 
00105     WT_Drawing_Info()
00106         : m_changed(0)
00107         , m_major_revision(0)
00108         , m_minor_revision(0)
00109     { }
00110 
00112     ~WT_Drawing_Info()
00113     { }
00114 
00115 
00116     WT_Drawing_Info (WT_Drawing_Info const & other)
00117         : m_changed         (other.m_changed)
00118         , m_major_revision  (other.m_major_revision)
00119         , m_minor_revision  (other.m_minor_revision)
00120         #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower) \
00121             , m_##class_lower (other.m_##class_lower)
00122             WHIP_DRAWING_INFO_LIST
00123         #undef WHIP_DRAWING_INFO_MACRO
00124     {  }
00125 
00126 
00127     WT_Drawing_Info & operator= (WT_Drawing_Info const & other)
00128     {
00129         m_changed         = other.m_changed;
00130         m_major_revision  = other.m_major_revision;
00131         m_minor_revision  = other.m_minor_revision;
00132         #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower) \
00133             m_##class_lower = other.m_##class_lower;
00134             WHIP_DRAWING_INFO_LIST
00135         #undef WHIP_DRAWING_INFO_MACRO
00136 
00137         return *this;
00138     }
00139 
00141 
00143 
00151     int decimal_revision() const
00152     {    return (major_revision() * 100) + minor_revision();    }
00153 
00155 
00158     int major_revision() const
00159     {    return m_major_revision;    }
00160 
00162 
00165     int minor_revision() const
00166     {    return m_minor_revision;    }
00168 
00173     #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower)\
00174         WT_##class_type const & class_lower() const  { return m_##class_lower; }
00175         WHIP_DRAWING_INFO_LIST
00176     #undef WHIP_DRAWING_INFO_MACRO
00177 
00178 
00183     #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower)\
00184         WT_##class_type & class_lower() { m_changed |=  class_type##_Bit ; return m_##class_lower; }
00185         WHIP_DRAWING_INFO_LIST
00186     #undef WHIP_DRAWING_INFO_MACRO
00187 
00188 
00190 
00194     WT_Result sync(WT_File & file);
00195 
00197 
00199     static WT_Result default_process(
00200         WT_Drawing_Info & item, 
00201         WT_File & file 
00202         );
00203 };
00204 
00206 
00207 #endif // DWGINFO_HEADER

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