pleyo.com

/src/trunk2/BAL/Interfaces/font/BTFontCache.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  *
00008  * 1.  Redistributions of source code must retain the above copyright
00009  *     notice, this list of conditions and the following disclaimer. 
00010  * 2.  Redistributions in binary form must reproduce the above copyright
00011  *     notice, this list of conditions and the following disclaimer in the
00012  *     documentation and/or other materials provided with the distribution. 
00013  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
00014  *     its contributors may be used to endorse or promote products derived
00015  *     from this software without specific prior written permission. 
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
00018  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00020  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
00021  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00022  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00023  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00024  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00029 #ifndef BTFontCache_h
00030 #define BTFontCache_h
00031 
00032 #ifdef __OWB__
00033 #include "Font.h"
00034 #include "FontData.h"
00035 #include "FontPlatformData.h"
00036 #endif //__OWB__
00037 #include <wtf/unicode/Unicode.h>
00038 
00039 #if PLATFORM(WIN)
00040 #include <mlang.h>
00041 #endif
00042 
00043 namespace WebCore
00044 {
00045 
00046 class AtomicString;
00047 #ifndef __OWB__
00048 class FontData;
00049 class FontPlatformData;
00050 class Font;
00051 #endif //__OWB__
00052 class FontDescription;
00053 class FontSelector;
00054 
00055 #ifdef __OWB__
00056 }
00057 
00058 using BAL::BTFont;
00059 using BAL::BTFontData;
00060 using BAL::BTFontPlatformData;
00061 using WebCore::AtomicString;
00062 
00063 namespace BAL {
00064 #endif //__OWB__
00065 
00066 class BTFontCache {
00067 public:
00068     static const FontData* getFontData(const Font&, int& familyIndex, FontSelector*);
00069 
00070     // This method is implemented by the platform.
00071     static const FontData* getFontDataForCharacters(const Font&, const UChar* characters, int length);
00072     
00073     // Also implemented by the platform.
00074     static void platformInit();
00075 
00076 #if PLATFORM(WIN)
00077     static IMLangFontLink2* getFontLinkInterface();
00078 #endif
00079 
00080     static bool fontExists(const FontDescription&, const AtomicString& family);
00081 
00082     static FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
00083     static FontData* getCachedFontData(const FontPlatformData*);
00084     static FontPlatformData* getLastResortFallbackFont(const FontDescription&);
00085     
00086 private:
00087     // These methods are implemented by each platform.
00088     static FontPlatformData* getSimilarFontPlatformData(const Font&);
00089     static FontPlatformData* createFontPlatformData(const FontDescription&, const AtomicString& family);
00090 
00091     friend class FontData;
00092 #ifdef __OWB__
00093     friend class WebCore::FontFallbackList;
00094 #else
00095     friend class FontFallbackList;
00096 #endif //__OWB__
00097 };
00098 
00099 }
00100 
00101 #endif //BTFontCache_h

Generated on Wed Nov 21 20:04:17 2007 for Origyn Web Browser by Doxygen 1.5.3

pleyo.com
pleyo.com