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

Doc.hh

Go to the documentation of this file.
00001 /*
00002     libpdf++: a C++ Free library to generate PDF file
00003     Copyright (C) 2002 Nestal Wan
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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     // construction and destruction
00123     CDoc( ) ;
00124     ~CDoc( ) ;
00125 
00126     // operations
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     // PDF document info
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

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