00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00026 #ifndef __PDF_DOC_HEADER_INCLUDED__
00027 #define __PDF_DOC_HEADER_INCLUDED__
00028
00029 #ifndef __PDF_PAGE_INFO_HEADER_INCLUDED__
00030 #include "page/Info.hh"
00031 #endif
00032
00033 #ifndef __PDF_PAGE_RES_DICT_HEADER_INCLUDED__
00034 #include "page/ResDict.hh"
00035 #endif
00036
00037 #ifndef __PDF_DOC_INFO_HEADER_INCLUDED__
00038 #include "DocInfo.hh"
00039 #endif
00040
00041 #include <vector>
00042 #include <iosfwd>
00043
00049 namespace pdf {
00050
00051 class CDocInfo ;
00052
00053 namespace core
00054 {
00055 class CFile ;
00056 class CObjRef ;
00057 class CObject ;
00058 }
00059
00060 namespace page
00061 {
00062 class CPage ;
00063 class CInfo ;
00064 }
00065
00100 class CDoc
00101 {
00102 public :
00103 typedef std::vector<page::CPage>::size_type size_type ;
00104
00105 private :
00107 std::vector<page::CPage> m_pages ;
00108
00112 page::CResDict m_res_dict ;
00113
00115 page::CInfo m_default_page_info ;
00116
00119 CDocInfo m_doc_info ;
00120
00121 public :
00122
00123 CDoc( ) ;
00124 ~CDoc( ) ;
00125
00126
00127 void AddPage( const page::CPage& page ) ;
00128 void AddFont( font::CFont *font ) ;
00129 void AddXObj( graph::CXObject *xobj ) ;
00130 std::ostream& Write( std::ostream& os ) const ;
00131 page::CPage& operator[]( size_type index ) ;
00132 const page::CPage& operator[]( size_type index ) const ;
00133
00134
00135 void Info( const CDocInfo& doc_info ) ;
00136 const CDocInfo& Info( ) const ;
00137
00138 private :
00139 const core::CObjRef WritePageTree( core::CFile& file ) const ;
00140
00141 #ifdef _DEBUG
00142 bool IsValid( ) const ;
00143 #endif
00144 } ;
00145
00146 inline std::ostream& operator<<( std::ostream& os, const CDoc& doc )
00147 {
00148 return doc.Write( os ) ;
00149 }
00150
00151 }
00152
00153 #endif