00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef __PDF_PAGE_INFO_HEADER_INCLUDED__
00028 #define __PDF_PAGE_INFO_HEADER_INCLUDED__
00029
00030 #ifndef __PDF_COMMON_RECT_HEADER_INCLUDED__
00031 #include "common/Rect.hh"
00032 #endif
00033
00034 namespace pdf {
00035
00036 namespace core
00037 {
00038 class CDictionary ;
00039 }
00040
00041 namespace page {
00042
00077 class CInfo
00078 {
00079 private :
00080 common::CRect m_media_box ;
00081 common::CRect m_crop_box ;
00082 common::CRect m_bleed_box ;
00083 common::CRect m_trim_box ;
00084 common::CRect m_art_box ;
00085
00089 int m_rotation ;
00090
00091 public :
00092
00093 CInfo( ) ;
00094 CInfo( double width, double height ) ;
00095 ~CInfo( ) ;
00096
00097
00098 CInfo& operator=( const CInfo& other ) ;
00099 void Assign( double width, double height ) ;
00100 void Swap( CInfo& other ) ;
00101
00102
00103 bool operator==( const CInfo& info ) const ;
00104 bool operator!=( const CInfo& info ) const
00105 { return !operator==( info ) ; }
00106
00107
00108 void MediaBox( const common::CRect& rect ) { m_media_box = rect ; }
00109 void CropBox( const common::CRect& rect ) { m_crop_box = rect ; }
00110 void BleedBox( const common::CRect& rect ) { m_bleed_box = rect ; }
00111 void TrimBox( const common::CRect& rect ) { m_trim_box = rect ; }
00112 void ArtBox( const common::CRect& rect ) { m_art_box = rect ; }
00113 void Rotation( int rotation ) ;
00114 const common::CRect& MediaBox( ) const { return m_media_box ; }
00115 const common::CRect& CropBox( ) const { return m_crop_box ; }
00116 const common::CRect& BleedBox( ) const { return m_bleed_box ; }
00117 const common::CRect& TrimBox( ) const { return m_trim_box ; }
00118 const common::CRect& ArtBox( ) const { return m_art_box ; }
00119 int Rotation( ) const { return m_rotation ; }
00120
00121
00122 void Write( core::CDictionary *dict, const CInfo& def ) const ;
00123 } ;
00124
00125 } }
00126
00127 namespace std
00128 {
00129 template <typename T>
00130 void swap( T& t1, T& t2 ) ;
00131
00132 template <>
00133 inline void swap( pdf::page::CInfo& p1, pdf::page::CInfo& p2 )
00134 {
00135 p1.Swap( p2 ) ;
00136 }
00137 }
00138
00139 #endif