fontservices/fontstore/inc/FNTSTORE.h
branchRCL_3
changeset 11 6971d1c87c9a
parent 5 e96e8a131979
child 15 9a2be90ac9a2
equal deleted inserted replaced
5:e96e8a131979 11:6971d1c87c9a
    63 class TShapeMessageParameters;
    63 class TShapeMessageParameters;
    64 class CTypefaceSupportInfo;
    64 class CTypefaceSupportInfo;
    65 class COpenFontRasterizer;
    65 class COpenFontRasterizer;
    66 class CLinkedTypefaceGroup;
    66 class CLinkedTypefaceGroup;
    67 IMPORT_C extern const TInt8 KLinkedFontDrive;
    67 IMPORT_C extern const TInt8 KLinkedFontDrive;
    68 IMPORT_C extern const TUint32 KFontTable_GlyphOutline_CacheMaxMem;
       
    69 
    68 
    70 /**
    69 /**
    71 WARNING: Class for internal use ONLY.  Compatibility is not guaranteed in future releases.
    70 WARNING: Class for internal use ONLY.  Compatibility is not guaranteed in future releases.
    72 @publishedAll
    71 @publishedAll
    73 @released
    72 @released
   161 	IMPORT_C void operator delete(TAny*);
   160 	IMPORT_C void operator delete(TAny*);
   162 	inline TBool IsOpenFont() const;
   161 	inline TBool IsOpenFont() const;
   163 	inline COpenFont* OpenFont() const;
   162 	inline COpenFont* OpenFont() const;
   164 	inline TGlyphBitmapType GlyphBitmapType() const;
   163 	inline TGlyphBitmapType GlyphBitmapType() const;
   165 	IMPORT_C TUint32 UniqueFontId();
   164 	IMPORT_C TUint32 UniqueFontId();
   166 	IMPORT_C TInt GetFontTable(TUint32 aTag, TAny*& aTableContent, 
   165 	
   167 	        TInt& aLength, TInt aSessionHandle);
       
   168     IMPORT_C TInt GetGlyphOutline(TUint aCode,  
       
   169             TBool aHinted, TAny*& aOutline, TInt& aLength, TInt aSessionHandle);
       
   170     IMPORT_C void ReleaseGlyphOutlines(TInt aCount, const TUint* aCodes,  
       
   171             TBool aHinted, TInt aSessionHandle);
       
   172     IMPORT_C void ReleaseFontTable(TUint32 aTag, TInt aSessionHandle);
       
   173     
       
   174 private:
   166 private:
   175 	// From CFont
   167 	// From CFont
   176 	IMPORT_C virtual TUid DoTypeUid() const;
   168 	IMPORT_C virtual TUid DoTypeUid() const;
   177 	IMPORT_C virtual TInt DoHeightInPixels() const;
   169 	IMPORT_C virtual TInt DoHeightInPixels() const;
   178 	IMPORT_C virtual TInt DoAscentInPixels() const;
   170 	IMPORT_C virtual TInt DoAscentInPixels() const;
   281 	
   273 	
   282 	IMPORT_C void operator = (const CLinkedTypefaceSpecification& aRhs);
   274 	IMPORT_C void operator = (const CLinkedTypefaceSpecification& aRhs);
   283 	IMPORT_C void operator = (const COpenFontLinkedTypefaceSpecification& aRhs);
   275 	IMPORT_C void operator = (const COpenFontLinkedTypefaceSpecification& aRhs);
   284 	};
   276 	};
   285 	
   277 	
   286 
       
   287 
       
   288 class TUnhintedOutlineId;
       
   289 class THintedOutlineId;
       
   290 class CFontTableCache;
       
   291 class CUnhintedOutlineCache;
       
   292 class CHintedOutlineCache;
       
   293 class TFontTableGlyphOutlineCacheMemMonitor;
       
   294 
       
   295 class CFontStore : public CTypefaceStore
   278 class CFontStore : public CTypefaceStore
   296 /** 
   279 /** 
   297 A store for fonts.
   280 A store for fonts.
   298 
   281 
   299 Stores and handles both open and fixed-size fonts. Open fonts are made from 
   282 Stores and handles both open and fixed-size fonts. Open fonts are made from 
   348 	IMPORT_C void GetLinkedTypefaceL(TLinkedTypefaceSpecificationArgs &aLinkedTypefaceSpec);
   331 	IMPORT_C void GetLinkedTypefaceL(TLinkedTypefaceSpecificationArgs &aLinkedTypefaceSpec);
   349 	IMPORT_C TBool HaveTypefaceFamilyName(const TDesC& aName);
   332 	IMPORT_C TBool HaveTypefaceFamilyName(const TDesC& aName);
   350 	IMPORT_C void UpdateLinkedTypefaceL(const TLinkedTypefaceSpecificationArgs& aLinkedTypefaceSpec);
   333 	IMPORT_C void UpdateLinkedTypefaceL(const TLinkedTypefaceSpecificationArgs& aLinkedTypefaceSpec);
   351 	IMPORT_C void LoadFontsAtStartupL();
   334 	IMPORT_C void LoadFontsAtStartupL();
   352 	IMPORT_C TBool GetFontFilePath(const TDesC& aFontName, TFileName& aFilePath) const;
   335 	IMPORT_C TBool GetFontFilePath(const TDesC& aFontName, TFileName& aFilePath) const;
   353     IMPORT_C void CleanupCacheOnFbsSessionTermination(TInt aSessionHandle);
       
   354 	
       
   355 	TInt CacheFontTable(TUid aFileUid, TUint32 aTag, TAny*& aContent, TInt aLength);
       
   356 	TInt ReleaseFontTable(TUid aFileUid, TUint32 aTag, TInt aSessionHandle);
       
   357 	TInt FindFontTableInCache(TUid aFileUid, TUint32 aTag, TAny*& aContent, TInt& aLength);
       
   358 	TInt IncFontTableRefCount(TUid aFileUid, TUint32 aTag, TInt aSessionHandle);
       
   359 	TInt DecFontTableRefCount(TUid aFileUid, TUint32 aTag, TInt aSessionHandle);
       
   360 	TInt CacheUnhintedOutline(const TUnhintedOutlineId& aOutlineId, TAny* aData, 
       
   361 	        TInt aLength, TAny*& aOutline, TInt& aLen);
       
   362 	TInt CacheHintedOutline(const THintedOutlineId& aOutlineId, TAny* aData, TInt aLength,
       
   363 	        TAny*& aOutline, TInt& aLen);
       
   364 	TInt ReleaseUnhintedOutline(const TUnhintedOutlineId& aOutlineId, TInt aSessionHandle);
       
   365 	TInt ReleaseHintedOutline(const THintedOutlineId& aOutlineId, TInt aSessionHandle);
       
   366 	TInt IncreaseUnhintedOutlineRefCount(const TUnhintedOutlineId& aOutlineId, TInt aSessionHandle);
       
   367 	TInt IncreaseHintedOutlineRefCount(const THintedOutlineId& aOutlineId, TInt aSessionHandle);
       
   368 	TInt FindUnhintedOutlineInCache(const TUnhintedOutlineId& aOutlineId, TAny*& aData, 
       
   369 	        TInt &aLength);
       
   370 	TInt FindHintedOutlineInCache(const THintedOutlineId& aOutlineId, TAny*& aData, TInt& aLength);
       
   371     void CleanupCacheOnOpenFontRemoval(COpenFont* aFont);
       
   372     void CleanupCacheOnOpenFontFileRemoval(COpenFontFile* aFontFile);
       
   373 
       
   374 private:
   336 private:
   375 	CFontStore(RHeap* aHeap);
   337 	CFontStore(RHeap* aHeap);
   376 	void ConstructL();
   338 	void ConstructL();
   377 	void InternalizeFontStoreFileL(CFontStoreFile* aFontStoreFile, TInt aFontVersion);
   339 	void InternalizeFontStoreFileL(CFontStoreFile* aFontStoreFile, TInt aFontVersion);
   378 	TTypeface* GetNearestTypeface(const TTypeface& aTypeface) const;
   340 	TTypeface* GetNearestTypeface(const TTypeface& aTypeface) const;
   431 	CArrayPtrFlat<CFontStoreFile> iFontStoreFileList;
   393 	CArrayPtrFlat<CFontStoreFile> iFontStoreFileList;
   432 	CArrayPtrFlat<TTypeface> iTypefaceList;
   394 	CArrayPtrFlat<TTypeface> iTypefaceList;
   433 	CArrayPtrFlat<CFontBitmap> iFontBitmapList;
   395 	CArrayPtrFlat<CFontBitmap> iFontBitmapList;
   434 	CArrayFixFlat<TTypefaceFontBitmap> iTypefaceFontBitmapList;
   396 	CArrayFixFlat<TTypefaceFontBitmap> iTypefaceFontBitmapList;
   435 	CArrayPtrFlat<COpenFontFile> iOpenFontFileList;
   397 	CArrayPtrFlat<COpenFontFile> iOpenFontFileList;
   436 	TInt iReserved[2];		// keep iDefaultBitmapType at the correct offset
   398 	TInt iReserved[6];		// keep iDefaultBitmapType at the correct offset
   437     CFontTableCache *iFontTableCache;
       
   438     CUnhintedOutlineCache *iUnhintedOutlineCache;
       
   439     CHintedOutlineCache *iHintedOutlineCache;
       
   440     TFontTableGlyphOutlineCacheMemMonitor *iCacheMemMon;
       
   441 	CArrayPtrFlat<COpenFontRasterizer> iOpenFontRasterizerList;
   399 	CArrayPtrFlat<COpenFontRasterizer> iOpenFontRasterizerList;
   442 	COpenFontSessionCacheList* iOpenFontSessionCacheList;
   400 	COpenFontSessionCacheList* iOpenFontSessionCacheList;
   443 	TInt iOpenFontUid;
   401 	TInt iOpenFontUid;
   444 	TGlyphBitmapType iDefaultBitmapType;
   402 	TGlyphBitmapType iDefaultBitmapType;
   445 	CArrayPtrFlat<CShaperFactory> iShaperFactoryList;
   403 	CArrayPtrFlat<CShaperFactory> iShaperFactoryList;