EmbeddedFont.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 #ifndef _DWFTK_EMBEDDED_FONT_H
00020 #define _DWFTK_EMBEDDED_FONT_H
00021 
00022 
00027 
00028 
00029 #include "dwfcore/STL.h"
00030 #include "dwfcore/Core.h"
00031 #include "dwfcore/String.h"
00032 #include "dwfcore/InputStream.h"
00033 using namespace DWFCore;
00034 
00035 #include "dwf/Toolkit.h"
00036 #include "dwf/package/FontResource.h"
00037 
00038 
00039 
00040     //
00041     // initial amount of memory we want to commit
00042     // towards the EFF stream buffer
00043     //
00044 #ifndef DWFTK_EMBEDDED_FONT_HEAP_INIT
00045 #define DWFTK_EMBEDDED_FONT_HEAP_INIT       4192
00046 #endif
00047 
00048     //
00049     // maximum amount of memory we want to commit
00050     // towards this particular EFF (embedded font file)
00051     // if the actual EFF exceeds this limit, 
00052     // a temporary disk file will be used instead
00053     //
00054 #ifndef DWFTK_EMBEDDED_FONT_HEAP_LIMIT
00055 #define DWFTK_EMBEDDED_FONT_HEAP_LIMIT      65536
00056 #endif
00057 
00058 
00059 
00060 namespace DWFToolkit
00061 {
00062 
00075 class DWFEmbeddedFontImpl _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE
00076 {
00077 
00078 public:
00079 
00085     virtual ~DWFEmbeddedFontImpl()
00086         throw()
00087     {;}
00088 
00089 #ifndef DWFTK_READ_ONLY
00090 
00094     _DWFTK_API
00095     virtual void addCharacters( const DWFString& rCharacters )
00096         throw( DWFException ) = 0;
00097 
00101     _DWFTK_API
00102     virtual void embed()
00103         throw( DWFException ) = 0;
00104 
00108     _DWFTK_API
00109     virtual DWFInputStream* getInputStream()
00110         throw( DWFException ) = 0;
00111 
00115     _DWFTK_API
00116     virtual const DWFString& getFaceName()
00117     throw( DWFException ) = 0;
00118 
00122     _DWFTK_API
00123     virtual const DWFString& getLogfontName()
00124     throw( DWFException ) = 0;
00125 
00126 
00127 #endif
00128 
00132     _DWFTK_API
00133     virtual int getRequest()
00134         throw( DWFException ) = 0;
00135 
00139     _DWFTK_API
00140     virtual DWFFontResource::tePrivilege getPrivilege()
00141         throw( DWFException ) = 0;
00142 
00146     _DWFTK_API
00147     virtual DWFFontResource::teCharacterCode getCharacterCode()
00148         throw( DWFException ) = 0;
00149 
00153     _DWFTK_API
00154     virtual void load( bool bForceRename = true )
00155         throw ( DWFException ) = 0;
00156 
00160     _DWFTK_API
00161     virtual const DWFString& loadedFontName() const
00162         throw( DWFException ) = 0;
00163 
00167     _DWFTK_API
00168     virtual void unload()
00169         throw ( DWFException ) = 0;
00170 
00171 protected:
00172 
00178     _DWFTK_API
00179     DWFEmbeddedFontImpl()
00180         throw()
00181     {;}
00182 
00183 private:
00184 
00185     DWFEmbeddedFontImpl( const DWFEmbeddedFontImpl& );
00186     DWFEmbeddedFontImpl& operator=( const DWFEmbeddedFontImpl& );
00187 };
00188 
00189 
00190 
00205 class DWFEmbeddedFont       _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE
00206 {
00207 
00208 public:
00209 
00213     typedef _DWFTK_STD_VECTOR(DWFEmbeddedFont*) tList;
00214 
00215 public:
00216 
00224     _DWFTK_API
00225     DWFEmbeddedFont( DWFEmbeddedFontImpl* pImpl )
00226         throw();
00227 
00233     _DWFTK_API
00234     ~DWFEmbeddedFont()
00235         throw();
00236 
00237 #ifndef DWFTK_READ_ONLY
00238 
00265     _DWFTK_API
00266     void addCharacters( const DWFString& rCharacters )
00267         throw( DWFException );
00268 
00279     _DWFTK_API
00280     void embed()
00281         throw( DWFException );
00282 
00291     _DWFTK_API
00292     DWFInputStream* getInputStream()
00293         throw( DWFException );
00294 
00301     _DWFTK_API
00302     const DWFString& getFaceName()
00303         throw( DWFException );
00304 
00311     _DWFTK_API
00312     const DWFString& getLogfontName()
00313         throw( DWFException );
00314 
00315 
00316 #endif
00317 
00324     _DWFTK_API
00325     int getRequest()
00326         throw( DWFException );
00327 
00334     _DWFTK_API
00335     DWFFontResource::tePrivilege getPrivilege()
00336         throw( DWFException );
00337 
00344     _DWFTK_API
00345     DWFFontResource::teCharacterCode getCharacterCode()
00346         throw( DWFException );
00347 
00354     _DWFTK_API
00355     void load( bool bForceRename = true )
00356         throw ( DWFException );
00357 
00364     _DWFTK_API
00365     const DWFString& loadedFontName() const
00366         throw( DWFException );
00367 
00373     _DWFTK_API
00374     void unload()
00375         throw ( DWFException );
00376 
00377 private:
00378 
00379     DWFEmbeddedFontImpl* _pImpl;
00380 
00381 private:
00382 
00383     DWFEmbeddedFont();
00384     DWFEmbeddedFont( const DWFEmbeddedFont& );
00385     DWFEmbeddedFont& operator=( const DWFEmbeddedFont& );
00386 };
00387 
00388 
00389 }
00390 
00391 
00392 #endif
00393 

Generated on Tue Jan 6 22:40:03 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5