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

State.hh

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_TEXT_STATE_HEADER_INCLUDED__
00027 #define __PDF_TEXT_STATE_HEADER_INCLUDED__
00028 
00029 #ifndef __PDF_UTIL_MATRIX2D_HEADER_INCLUDED__
00030 #include "util/Matrix2D.hh"
00031 #endif
00032 
00033 #ifndef __PDF_UTIL_COLOUR_HEADER_INCLUDED__
00034 #include "util/Colour.hh"
00035 #endif
00036 
00037 #include <iosfwd>
00038 #include <algorithm>
00039 
00040 namespace pdf {
00041 
00042 namespace font
00043 {
00044     class CFont ;
00045 }
00046 
00047 namespace text {
00048 
00060 class CState
00061 {
00062 private :
00063     const font::CFont *m_font ;     
00064 
00065 
00066     double   m_font_size ;          
00067     double   m_char_space ;         
00068     double   m_word_space ;         
00069     double   m_scale ;              
00070     double   m_leading ;            
00071     int      m_render ;             
00072     double   m_rise ;               
00073 
00074     util::CColour   m_colour ;      
00075 
00076 public :
00077     CState( ) ;
00078     CState( const font::CFont *font, double font_size,
00079                 double leading = 0, double char_space = 0,
00080                 double word_space = 0, double scale = 1.0f,
00081                 int render = 0, double rise = 0 ) ;
00082     CState( const CState& text ) ;
00083 
00084     // assignments
00085     CState& operator=( const CState& state ) ;
00086     void Swap( CState& state ) ;
00087 
00088     std::ostream& Write( std::ostream& os, const CState& prev ) const ; 
00089 
00091     double Leading( ) const { return m_leading ; }
00092 
00093     // colour functions
00094     void Colour( const util::CColour& colour ) ;
00095     const util::CColour Colour( ) const ;
00096     
00097     const font::CFont* Font( ) const ;
00098     double Scale( ) const ;
00099     double FontSize( ) const ;
00100 } ;
00101 
00102 } } // end of namespace
00103 
00104 namespace std
00105 {
00106     template <>
00107     inline void swap( pdf::text::CState& s1, pdf::text::CState& s2 )
00108     {
00109         s1.Swap( s2 ) ;
00110     }
00111 } // end of namespace std
00112 
00113 #endif

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