Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Info.hh

Go to the documentation of this file.
00001 /*
00002 
00003     libpdf++: a C++ Free library to generate PDF file
00004     Copyright (C) 2002 Nestal Wan
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 2.1 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU Lesser General Public
00017     License along with this library; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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     // construction and destruction
00093     CInfo( ) ;
00094     CInfo( double width, double height ) ;
00095     ~CInfo( ) ;
00096 
00097     // assignment and swap
00098     CInfo& operator=( const CInfo& other ) ;
00099     void Assign( double width, double height ) ;
00100     void Swap( CInfo& other ) ;
00101 
00102     // equality operator
00103     bool operator==( const CInfo& info ) const ;
00104     bool operator!=( const CInfo& info ) const
00105         { return !operator==( info ) ; }
00106     
00107     // attributes
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     // operations
00122     void Write( core::CDictionary *dict, const CInfo& def ) const ;
00123 } ;
00124 
00125 } } // end of namespace
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

Generated on Sun Feb 2 09:16:05 2003 for libpdf++ by doxygen1.2.16